Question

What are the characteristics of handling Socket and ServerSocket ?

What are the characteristics of handling Socket and ServerSocket ?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

handling Socket handled in the client side

client sent a request and it has to wait for the server to respond where the connection of the client and server should be alive so that it can be maintined to send data from one end to another end so there is time frame to stay connected.

when the client sent a request the server listens to the port which is assigned in the program and it has a hostname and ip adddress so that it will find the correct server to get the response from the server.

the following are the process that might happen for transfering data

connect,connecting,disconnect,error,reconnect,reconnect failed.

there is also error handling method available reconnect failed() where the server gives a actions to client to wait for connect or close the client .we can specify some other handling methods to handle error in the connection for making the system more reliable.

server

ServerSocket S = new ServerSocket(9000)//listens to port and the port number is always assigned to it

through this port only the connection is established.

there is ServerSocket.accept() method for each connection where after approval only the connection get approved. there is only one accept method opened for the connections.

then the close method is used to close the connection to the server.

Add a comment
Know the answer?
Add Answer to:
What are the characteristics of handling Socket and ServerSocket ?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT