aspose file tools
The moose likes Sockets and Internet Protocols and the fly likes getting InetAddress over UDP protocol Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Reply Bookmark "getting InetAddress over UDP protocol" Watch "getting InetAddress over UDP protocol" New topic
Author

getting InetAddress over UDP protocol

aymane chetibi
Ranch Hand

Joined: Apr 12, 2006
Posts: 175
Hi all,

I am trying to connect to a server over UDP.
how can I get the "raw IP Address" as they call it in the documentation starting from the normal ip "10.10.12.123" ??

this raw IP address as a byte[] is the agrument passed to the constructor of an InetAddress class.

Thanks a lot for your help.
regards,
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8264

Use InetAddress.getByName():
Determines the IP address of a host, given the host's name.

The host name can either be a machine name, such as "java.sun.com", or a textual representation of its IP address. If a literal IP address is supplied, only the validity of the address format is checked.

java.net.InetAddress


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: getting InetAddress over UDP protocol
 
Similar Threads
how to get IP address in linux
get the IP Address
Fetcth the Router's Mac Address
about IP
Can I get source ip address and destination ip address of udp packet?