Professional Documents
Culture Documents
Rahul Singh, Aakash Singh Rajput, Jyoti Rani Sahu NP Implementation of Generic Networkclient
Rahul Singh, Aakash Singh Rajput, Jyoti Rani Sahu NP Implementation of Generic Networkclient
Rahul Singh, Aakash Singh Rajput, Jyoti Rani Sahu NP Implementation of Generic Networkclient
Generic Client
Implementing a 01 Create a Socket object.
Generic Client
consists of five 02 Create an output stream that can be used to
send information to the Socket.
basic steps
03
Create an input stream to read the
response from the server.
InputStreamReader in =
new InputStreamReader(client.getInputStream());
Do I/O with input and output streams.
A PrintStream has print and println methods that let you send a single primitive value, a String,
or a string representation of an Object over the network. If you send an Object, the object is
converted to a String by calling the toString method of the class. Most likely you are already
familiar with these methods, since System.out is in fact an instance of Print_Stream.
PrintStream also inherits some simple write methods from OutputStream. These methods let
you send binary data by sending an individual byte or an array of bytes.
Close the Socket when
done
When you are done, close the socket with the close method:
Client.close();
This method closes the associated input and output streams as well.
RAHUL SINGH
OUR TEAM
AAKASH SINGH RAJPUT