Implementing network protocol easily with a generic SocketClient