split the serve_client function
encapsulate the socket stuff in a coroutine_socket class