[Logo]
Forums Register Login
getting InetAddress over UDP protocol
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,
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
You guys wanna see my fabulous new place? Or do you wanna look at this tiny ad?
ScroogeXHTML 7.1 - RTF to HTML5 / XHTML converter
https://coderanch.com/t/690611/ScroogeXHTML-RTF-HTML-XHTML-converter


This thread has been viewed 894 times.

All times above are in ranch (not your local) time.
The current ranch time is
Feb 22, 2018 21:49:29.