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