473,320 Members | 1,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 10887
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Stefan Mueller | last post by:
I've just installed phpMyAdmin. If I have the line $cfg = 'http://localhost/php/phpmyadmin'; in my config.inc.php I can login to phpMyAdmin without any problems from my local machine. But it's...
2
by: Sherif ElMetainy | last post by:
Hello I am writing a HTTP client, that will run on a computer with multiple IP addresses. I want to bind the TCP socket for the HTTP connection to a specific IP address, but unfortunately there...
0
by: Gregory Hassett | last post by:
Hello, I want to periodically send a TCP packet to a peer, always from the same source port. That is, each packet will come from my local ip address, port 8801, and go to the peer's ip address,...
6
by: pekspro | last post by:
I need some code that gets the address from a server. I read somewhere that you could do this by starting some broadcast server using UDP. The client should send an broadcast message, and when the...
6
by: Brad | last post by:
I have a win2003 server workstation with multiple webs, each web has it's own ip address. In VS2005, if I select to open an existing web site, select Local IIS, the dialog correctly displays a...
6
by: Zytan | last post by:
Once a socket is connected, perhaps to a hostname that contains multiple IP addresses, how can I determine to which IP address the connection is made? The only thing I can get from my Socket is an...
1
by: jcprince | last post by:
Hi Not sure I can do what I'm trying to do without using a 3rd party component like Dart. I need to build a windows service to create a socket connection on an IBM mainframe using an IP and port...
2
by: 000dreamsound000 | last post by:
Hi I am working on a security network camera system as part of a summer project of mine. The camera allows use of a TCP server for event configuration. I have coded a simple TCP server which beeps...
0
by: Xionbox | last post by:
Hello everybody, The error I have seems very easy to solve, but for some odd reason I can't seem to solve it. Anyways, here's my "setup". I created a server running on localhost:1200 (telnet...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.