By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,510 Members | 1,815 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,510 IT Pros & Developers. It's quick & easy.

finding the local IP address without socket connection?

P: n/a
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
Share this Question
Share on Google+
7 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
hi
have you checked java.net.NetworkInterface class ?
you can print details of your network card.
regards
amey
Jul 17 '05 #5

P: n/a
hi
have you checked java.net.NetworkInterface class ?
you can print details of your network card.
regards
amey
Jul 17 '05 #6

P: n/a
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

P: n/a
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.