fix typo in recv_long
more implementation, specifically close_socket(), recv_data() and send_data()