Creating a server and a client and make the client receive a message from the server
In this program we make a server on the same machine as the one on which the client is running but you can make the client run on another machine also. Then we make a client and send a request to the server on port 5555 which is accepted by the server. The server is running in a loop waiting for connection requests from the clients.
When the server gets a request from the client, the client is connected on some anonymous port and a message is sent to the client which is displayed on the console also in this case. Then the server continues it wait for the other clients.
Here we make seven client instances and all of them repeat the process given above and get a message from the server which is displayed on the console.
No comments:
Post a Comment