p2p_client: separate getting addrinfo from creating sockets
separate socket helpers into socket_helper