Testing send and receive messages with sockets