#NEWLINE# def _run_server( local_addr , local_addr_family , local_socket_type , local_linger_args , remote_addr , remote_addr_family , remote_socket_type , queue ) : #NEWLINE# #INDENT# " Run the server; executed in the subprocess\n\n    :param local_addr: listening address\n    :param local_addr_family: listening address family; one of socket.AF_*\n    :param local_socket_type: listening socket type; typically\n        socket.SOCK_STREAM\n    :param tuple local_linger_args: SO_LINGER sockoverride for the local\n        connection sockets, to be configured after connection is accepted.\n        Pass None to not change SO_LINGER. Otherwise, its a two-tuple, where the\n        first element is the `l_onoff` switch, and the second element is the\n        `l_linger` value in seconds\n    :param remote_addr: address of the target server. Pass None to have\n        ForwardServer behave as echo server\n    :param remote_addr_family: address family for connecting to target server;\n        one of socket.AF_*\n    :param remote_socket_type: socket type for connecting to target server;\n        typically socket.SOCK_STREAM\n    :param multiprocessing.Queue queue: queue for depositing the forwarding\n        server's actual listening socket address family and bound address. The\n        parent process waits for this.\n    " #NEWLINE# class _ThreadedTCPServer ( SocketServer . ThreadingMixIn , SocketServer . TCPServer , object ) : #NEWLINE# #INDENT# 'Threaded streaming server for forwarding' #NEWLINE# address_family = local_addr_family #NEWLINE# socket_type = local_socket_type #NEWLINE# allow_reuse_address = True #NEWLINE# def __init__( self ) : #NEWLINE# #INDENT# handler_class_factory = partial ( _TCPHandler , local_linger_args = local_linger_args , remote_addr = remote_addr , remote_addr_family = remote_addr_family , remote_socket_type = remote_socket_type ) #NEWLINE# super ( _ThreadedTCPServer , self ) . __init__ ( local_addr , handler_class_factory , bind_and_activate = True ) #NEWLINE# #UNINDENT# #UNINDENT# server = _ThreadedTCPServer ( ) #NEWLINE# queue . put ( [ server . socket . family , server . server_address ] ) #NEWLINE# queue . close ( ) #NEWLINE# server . serve_forever ( )