← Back
Editing: stdio_test_hostpeer.cpython-38.pyc
U W[� � @ s� d Z ddlmZmZ ddlZddlmZmZ ddlm Z G dd� dej �Zedkr�e � ejd ��� dd lmZ e�e� � e�� dS )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 Zd Zdd� Zdd� ZdS )� HostPeerChildc C sD | j �d�t| j �� ��d�t| j �� ��d�g�� | j �� d S )N� �ascii)Z transport�write�join�strZgetHost�encodeZgetPeerZloseConnection)�self� r �B/usr/lib/python3/dist-packages/twisted/test/stdio_test_hostpeer.py�connectionMade s �zHostPeerChild.connectionMadec C s t �� d S )N)�reactor�stop)r �reasonr r r �connectionLost s zHostPeerChild.connectionLostN)�__name__� __module__�__qualname__r r r r r r r s r �__main__� )r )�__doc__Z __future__r r �sysZtwisted.internetr r Ztwisted.pythonr ZProtocolr r ZnamedAny�argv�installr Z StandardIO�runr r r r �<module> s
Save File
Cancel