adapt the structure between socket and tcp_connection