Working example: echo server and client