added code for client-server with a simple protocol