new creer_socket function in p2p_common