#NEWLINE# def _get_appsock_from_handshake( config , handshake_endpoint ) : #NEWLINE# #INDENT# app_info = utils . create_rep_socket_bound_to_random ( ) #NEWLINE# handshake_sock = compat . MQ . socket ( compat . MQ . REQ ) #NEWLINE# handshake_sock . connect ( handshake_endpoint ) #NEWLINE# handshake_sock . send ( config . dumps ( app_info . endpoint ) ) #NEWLINE# handshake_sock . recv ( ) #NEWLINE# handshake_sock . close ( ) #NEWLINE# return ( app_info . socket , app_info . endpoint )