java.net.InetAddress
InetAddress ina = InetAddress.getLocalHost();
InetAddress ina = InetAddress.getByName(hostNameString);
InetAddress[] ina = InetAddress.getAllByName(siteNameString);
http://129.11.93.2
will get the old School webserver.
http://www.geog.leeds.ac.uk
java.net.Socket
java.net.ServerSocket
Socket(InetAddress ipAdd, int port)
ServerSocket(int port)
accept()
method which returns a Socket when activated.
getInputStream()
, getOutputStream()
and close()
methods to talk using streams.
ServerSocket ss = new ServerSocket(9999);
Socket s = ss.accept();
BufferedInputStream in =
new BufferedInputStream(s.getInputStream());
Socket s = new Socket(iNetAddress, 9999);
BufferedOutputStream b =
new BufferedOutputStream(s.getOutputStream());
b.write(aByteArray);
s.close();