�
Ϫ�f!
� �� � d Z ddlmZmZ ddlmZ ddlmZmZ dej fd�Z
dded ej d
eej defd�Z
ded ej dej fd�Zd
dgZy)z�
Construct listening port services from a simple string description.
@see: L{twisted.internet.endpoints.serverFromString}
@see: L{twisted.internet.endpoints.clientFromString}
� )�Optional�cast)�StreamServerEndpointService)� endpoints�
interfaces�returnc �B � ddl m} t t j | � S )Nr ��reactor)�twisted.internetr r r �IReactorCorer
s �>/usr/lib/python3/dist-packages/twisted/application/strports.py�_getReactorr s � �(��
�'�'��1�1� N�description�factoryr c �l � |�
t � }t t j || � |� }d|_ |S )aj
Return the service corresponding to a description.
@param description: The description of the listening port, in the syntax
described by L{twisted.internet.endpoints.serverFromString}.
@type description: C{str}
@param factory: The protocol factory which will build protocols for
connections to this service.
@type factory: L{twisted.internet.interfaces.IProtocolFactory}
@rtype: C{twisted.application.service.IService}
@return: the service corresponding to a description of a reliable stream
server.
@see: L{twisted.internet.endpoints.serverFromString}
T)r r r �serverFromString�_raiseSynchronously)r r r �svcs r �servicer s; � �, ���-��
%��"�"�7�K�8�'��C� #�C���Jr c � � ddl m} t j | |� \ }}}t t
j t |d|z � |i |��� S )ac
Listen on a port corresponding to a description.
@param description: The description of the connecting port, in the syntax
described by L{twisted.internet.endpoints.serverFromString}.
@type description: L{str}
@param factory: The protocol factory which will build protocols on
connection.
@type factory: L{twisted.internet.interfaces.IProtocolFactory}
@rtype: L{twisted.internet.interfaces.IListeningPort}
@return: the port corresponding to a description of a reliable virtual
circuit server.
@see: L{twisted.internet.endpoints.serverFromString}
r r
�listen)r r r �_parseServerr r �IListeningPort�getattr)r r r �name�args�kws r r r 7 sO � �( )��+�+�K��A�N�D�$����!�!�#D�7�7�H�t�O�#D�d�#Q�b�#Q�� r r r )N)�__doc__�typingr r �twisted.application.internetr r r r r
r �str�IProtocolFactoryr r r �__all__� r r �<module>r' |