refine create_tcp_connection