added receive() in the client with a ring buffer