You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A brief description of the sample server and client example is as follows. In the example a server, using MSocket, starts behind NAT and waits for clients to connect to it. The client in the example connects to the server, which is behind NAT, and both the server and the client exchange hello world messages 10 times and then close their respective sockets.
To run the sample server and client example, open two terminal tabs and go inside the directory that contains the downloaded msocket-1.0.0.jar.
In the first tab, start the server following these steps.
myTestServer argument is the name of the server. This can be any name and it should be unique. On starting the server the following lines should be printed.
Starting a server with name myTestServer
Listening for incoming connections
If there is a DUPLICATE_NAME_EXCEPTION then the provided name is already taken by someone else in GNS. Restart the server with a different name.
In the second tab, start the client following these steps.
myTestServer argument is the name of the server to connect to. The name of the server should be same as given in the step 4.
Both the server and the client applications exchange hello word messages 10 times and then close their respective sockets. On completion, the TestMSocketServer prints Server application complete and TestMSocketClient prints Client application complete.
The above steps run both the server and the client on the same machine, but the server and the client applications can be run on different machines using the same steps.