The client tries to connect to the server on TCP port 27015. If the client and server are executed on the sample computer, the client can be started as follows: The client application requires that name of the computer or IP address of the computer where the server application is running is passed as a command-line parameter when the client is executed. To execute the client, compile the complete client source code and run the executable file. When the client shuts down the connection, the server shuts down the client socket, closes the socket, and exits. Once a client connects, the server receives data from the client and echoes (sends) the data received back to the client. The server application listens on TCP port 27015 for a client to connect. To execute the server, compile the complete server source code and run the executable file. The server application should be started before the client application is started. This section contains the complete source code for the TCP/IP Client and Server applications:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |