U
    
W[ý  ã                   @   sŠ   d Z ddlmZmZ ddlZddlmZmZ ddlm	Z	 G dd„ dej
ƒZedkr†e	 ejd	 ¡ ¡  dd
lmZ e eƒ ¡ e ¡  dS )zÈ
Main program for the child process run by
L{twisted.test.test_stdio.StandardInputOutputTests.test_hostAndPeer} to test
that ITransport.getHost() and ITransport.getPeer() work for process transports.
é    )Úabsolute_importÚdivisionN)ÚstdioÚprotocol)Úreflectc                   @   s   e Zd Zdd„ Zdd„ ZdS )ÚHostPeerChildc                 C   sD   | j  d t| j  ¡ ƒ d¡t| j  ¡ ƒ d¡g¡¡ | j  ¡  d S )Nó   
Úascii)Z	transportÚwriteÚjoinÚstrZgetHostÚencodeZgetPeerZloseConnection)Úself© r   úB/usr/lib/python3/dist-packages/twisted/test/stdio_test_hostpeer.pyÚconnectionMade   s
    
þzHostPeerChild.connectionMadec                 C   s   t  ¡  d S )N)ÚreactorÚstop)r   Úreasonr   r   r   ÚconnectionLost   s    zHostPeerChild.connectionLostN)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r   r      s   r   Ú__main__é   )r   )Ú__doc__Z
__future__r   r   ÚsysZtwisted.internetr   r   Ztwisted.pythonr   ZProtocolr   r   ZnamedAnyÚargvÚinstallr   Z
StandardIOÚrunr   r   r   r   Ú<module>   s   