previous
|
start
|
next
Client Program - Input and Output Streams
Use the input and output streams attached to the socket
s
to communicate with the other endpoint of the connection
Code to obtain the input and output streams
InputStream in = s.getInputStream(); OutputStream out = s.getOutputStream();
When you send data to the output stream
out
, the socket forwards them to the server
The socket catches the server's response and you can read it through the input stream
in
When you are done communicating with the server, close the socket
s.close();
previous
|
start
|
next