This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Sockets and Internet Protocols and the fly likes Problem getting local ip address Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Problem getting local ip address" Watch "Problem getting local ip address" New topic
Author

Problem getting local ip address

Tien Duong Nguyen
Greenhorn

Joined: Oct 22, 2004
Posts: 22
Hi,

Anybody knows how to get the computer ip address by using java ?

I have tried to use the method getInetAddress of ServerSocket class, but it always returns me the address 0.0.0.0. What I want is the computer static ip address or DHCP , e.g : 155.69.172.12

Really appreciate if anyone can help.

Regards,


SCEA (part 1), part 2,3 in progress<br /> <br />SCBCD,SCWCD,SCJP
David Harkness
Ranch Hand

Joined: Aug 07, 2003
Posts: 1646
Try
 
Don't get me started about those stupid light bulbs.
 
subject: Problem getting local ip address
 
Similar Threads
How to allow only some computers to access the web application in internet?
ip address
get the IP Address
IP address
Capturing IP address of the client machine