writing a good example for TCP echo server and client