combined the client and server for bidirectional communication