All of our Linux computers run a firewall protect them from people trying to connect to them illegitimately. This can conflict with your own development of client-server applications. There are three ways around this.
In many cases, you don't really need to run the server and the client(s) on different computers in order to test the program. If you run them all on the same computer (using the localhost computer name or the IP address 127.0.0.1), the firewall won't interfere.
But if you want to see your program run on different computers, you can use ssh to do this. Do the following from the command prompt, where port is the port that your server runs on, and remoteHost is the name of the computer that your server runs on (or will run on).
You will then have a prompt on the remote host. If you haven'tlocalHost% ssh -L port:remoteHost:port remoteHost password: yourPassword
already started the server, you can do it at this prompt. Don't terminate your ssh session until you are done with running your client.
You can then start your program with localhost as the name of the server (or the IP address 127.0.0.1), even though the server is running on a different computer. When the client program attaches to the port on the local host, ssh will accept this, send a message over its connection to the remote host (via its reserved port number, 22), and the remote host will connect to the server program. Any communication from client or server will then be relayed to the other via this ssh link - and, as a bonus, the communication will be encrypted.
Here is a different approach using ssh: You can use other computers to act simply as terminals for another computer. Thus, all instances of your program will actually run on just one computer, though it will appear on different screens.
Suppose that you are running your server on boromir, While
sitting at another computer, you could use ssh to connect
to boromir and then execute the client on boromir
(though you'll interact with the program at that other computer).
If your program uses a graphical user interface, that might seem
problematic, but ssh has a command-line option -X
(that's a capital X) saying that any windows opened while
on that remote computer boromir should actually appear on
that local computer: This is the -X option.
Thus, you can execute
to connect to boromir, then start your GUI program
from the boromir prompt on your computer, and
boromir machine will open
the window on your own monitor.ssh -X boromir
If for some reason none of the above approaches is adequate, discuss the issue further with a professor.