469,360 Members | 1,807 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,360 developers. It's quick & easy.

finding the local IP address without socket connection?

Hello,

I was wondering if anybody knew how to retrieve the IP address attributed
dynamically by your ISP without having to use the info collected
on a socket with say .getLocalAddress.

I'm using dsl with PPPoE and whenever i try to get the local address,
through InetAddress, the network address is returned. So i'm guessing that
InetAddress is out.My network is in the way and i don't think i can really go
around it. I can't seem to find any class that could help me out.

Any ideas?
Thanks in advance
Stonelock
Jul 17 '05 #1
7 10708
hi
not a good solution but definitely workaround one.
you can use exec to get all ipaddress using say "ipconfig -all" on win
platform & then parse the output
u can try this if nuthin else works or you need quick workaround soln
;)

regards
amey
cr**************@sympatico.ca wrote in message news:<b1**************************@posting.google. com>...
Hello,

I was wondering if anybody knew how to retrieve the IP address attributed
dynamically by your ISP without having to use the info collected
on a socket with say .getLocalAddress.

I'm using dsl with PPPoE and whenever i try to get the local address,
through InetAddress, the network address is returned. So i'm guessing that
InetAddress is out.My network is in the way and i don't think i can really go
around it. I can't seem to find any class that could help me out.

Any ideas?
Thanks in advance
Stonelock

Jul 17 '05 #2
Yeah i guess so but i was looking for a friendly and portable java
related solution of course ;}.
Right now, i'm using the method of connecting to www.yahoo.com on port
80 to get my own ip address
from the resulting temporary socket; its alright but i'd like to be
able to determine the same address
without having to involve a third party like im doing right now. In
that case, the InetAddress class seems
inadequate and so is the InetSocketAddress (which im using right now)
since it involves
a connected socket.

Any other idea?
Stonelock

am*****@yahoo.com (Amey Samant) wrote in message news:<66**************************@posting.google. com>...
hi
not a good solution but definitely workaround one.
you can use exec to get all ipaddress using say "ipconfig -all" on win
platform & then parse the output
u can try this if nuthin else works or you need quick workaround soln
;)

regards
amey
cr**************@sympatico.ca wrote in message news:<b1**************************@posting.google. com>...
Hello,

I was wondering if anybody knew how to retrieve the IP address attributed
dynamically by your ISP without having to use the info collected
on a socket with say .getLocalAddress.

I'm using dsl with PPPoE and whenever i try to get the local address,
through InetAddress, the network address is returned. So i'm guessing that
InetAddress is out.My network is in the way and i don't think i can really go
around it. I can't seem to find any class that could help me out.

Any ideas?
Thanks in advance
Stonelock

Jul 17 '05 #3
Yeah i guess so but i was looking for a friendly and portable java
related solution of course ;}.
Right now, i'm using the method of connecting to www.yahoo.com on port
80 to get my own ip address
from the resulting temporary socket; its alright but i'd like to be
able to determine the same address
without having to involve a third party like im doing right now. In
that case, the InetAddress class seems
inadequate and so is the InetSocketAddress (which im using right now)
since it involves
a connected socket.

Any other idea?
Stonelock

am*****@yahoo.com (Amey Samant) wrote in message news:<66**************************@posting.google. com>...
hi
not a good solution but definitely workaround one.
you can use exec to get all ipaddress using say "ipconfig -all" on win
platform & then parse the output
u can try this if nuthin else works or you need quick workaround soln
;)

regards
amey
cr**************@sympatico.ca wrote in message news:<b1**************************@posting.google. com>...
Hello,

I was wondering if anybody knew how to retrieve the IP address attributed
dynamically by your ISP without having to use the info collected
on a socket with say .getLocalAddress.

I'm using dsl with PPPoE and whenever i try to get the local address,
through InetAddress, the network address is returned. So i'm guessing that
InetAddress is out.My network is in the way and i don't think i can really go
around it. I can't seem to find any class that could help me out.

Any ideas?
Thanks in advance
Stonelock

Jul 17 '05 #4
hi
have you checked java.net.NetworkInterface class ?
you can print details of your network card.
regards
amey
Jul 17 '05 #5
hi
have you checked java.net.NetworkInterface class ?
you can print details of your network card.
regards
amey
Jul 17 '05 #6
Ahhhh!!! Wonderful

I wasn't aware of the existence of this class. Thanks a bunch for the info. This
should do the trick.

Thanks again :).
Stonelock
am*****@yahoo.com (Amey Samant) wrote in message news:<66**************************@posting.google. com>...
hi
have you checked java.net.NetworkInterface class ?
you can print details of your network card.
regards
amey

Jul 17 '05 #7
Ahhhh!!! Wonderful

I wasn't aware of the existence of this class. Thanks a bunch for the info. This
should do the trick.

Thanks again :).
Stonelock
am*****@yahoo.com (Amey Samant) wrote in message news:<66**************************@posting.google. com>...
hi
have you checked java.net.NetworkInterface class ?
you can print details of your network card.
regards
amey

Jul 17 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Stefan Mueller | last post: by
6 posts views Thread by pekspro | last post: by
6 posts views Thread by Zytan | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.