Forums Register Login

getting InetAddress over UDP protocol

+Pie Number of slices to send: Send
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,
+Pie Number of slices to send: Send
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
Whip out those weird instruments of science and probe away! I think it's a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1217 times.
Similar Threads
Can I get source ip address and destination ip address of udp packet?
Fetcth the Router's Mac Address
how to get IP address in linux
about IP
get the IP Address
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 03:18:49.