AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Returns the OutputStream attached with this socket. Returns the InputStream attached with this socket. The Socket class can be used to create a socket. Socket classĪ socket is simply an endpoint for communications between the machines. After the successful connection of client, it returns the instance of Socket at server-side. The accept() method of ServerSocket class blocks the console until the client is connected. The ServerSocket class is used at server-side. Through this class, we can read and write message. The Socket class is used to communicate client and server. Here, two classes are being used: Socket and ServerSocket. In this application, client sends a message to the server, server reads the message and prints it. Here, we are going to make one-way client and server communication. The client in socket programming must know two information: Socket and ServerSocket classes are used for connection-oriented socket programming and DatagramSocket and DatagramPacket classes are used for connection-less socket programming. Java Socket programming can be connection-oriented or connection-less. Java Socket programming is used for communication between the applications running on different JRE.
0 Comments
Read More
Leave a Reply. |