The following simple Server opens a port on 2000 and waits for incoming connections. Each connection is answered with the same line as was written (echoed).
If you want to test the server, use
telnet localhost 2000