← Back
Editing: strports.cpython-38.pyc
U W[� � @ sJ d Z ddlmZmZ ddlmZ ddlmZ d dd�Zdd � Z dd gZ dS )z� Construct listening port services from a simple string description. @see: L{twisted.internet.endpoints.serverFromString} @see: L{twisted.internet.endpoints.clientFromString} � )�absolute_import�division)�StreamServerEndpointService)� endpointsNc C s0 |dkrddl m} tt�|| �|�}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} Nr ��reactorT)�twisted.internetr r r ZserverFromStringZ_raiseSynchronously)�description�factoryr Zsvc� r �>/usr/lib/python3/dist-packages/twisted/application/strports.py�service s �r c C s2 ddl m} t�| |�\}}}t|d| �||�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 Z_parseServer�getattr)r r r �name�args�kwr r r r . s r )N)�__doc__Z __future__r r Ztwisted.application.internetr r r r r �__all__r r r r �<module> s
Save File
Cancel