CENG325 10 Networking
CENG325 10 Networking
This means the server waits until a client connect to the server
socket.
When you create a socket with a host name, the JVM asks the DNS to
translate the host name into the IP address.
Data Transmission through Sockets
After the server accepts the connection,
communication between the server and the
client is conducted in the same way as for I/O
streams.
To get an input stream and an output stream,
use the getInputStream() and
getOutputStream() methods on a socket
object.
InputStream input =
socket.getInputStream();
OutputStream output =
socket.getOutputStream();