HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/lib/python3/dist-packages/twisted/test/__pycache__/stdio_test_halfclose.cpython-38.pyc
U


W[��@s�dZddlmZmZddlZddlmZddlmZddl	m
Z
mZddlm
Z
mZee�Gdd	�d	ej��Zed
kr�e
�ejd���e�eejdd
��ddl	mZe�Ze
�e�e��e�ej�dS)z�
Main program for the child process run by
L{twisted.test.test_stdio.StandardInputOutputTests.test_readConnectionLost}
to test that IHalfCloseableProtocol.readConnectionLost works for process
transports.
�)�absolute_import�divisionN)�implementer)�IHalfCloseableProtocol)�stdio�protocol)�reflect�logc@s,eZdZdZdZdd�Zdd�Zdd�ZdS)	�HalfCloseProtocolz�
    A protocol to hook up to stdio and observe its transport being
    half-closed.  If all goes as expected, C{exitCode} will be set to C{0};
    otherwise it will be set to C{1} to indicate failure.
    NcCs|j�d�dS)z=
        Signal the parent process that we're ready.
        �xN)Z	transport�write��self�r�C/usr/lib/python3/dist-packages/twisted/test/stdio_test_halfclose.py�connectionMade sz HalfCloseProtocol.connectionMadecCsd|_t��dS)zv
        This is the desired event.  Once it has happened, stop the reactor so
        the process will exit.
        rN)�exitCode�reactor�stopr
rrr�readConnectionLost'sz$HalfCloseProtocol.readConnectionLostcCs(|jdkrd|_t�|d�t��dS)z�
        This may only be invoked after C{readConnectionLost}.  If it happens
        otherwise, mark it as an error and shut down.
        N�z!Unexpected call to connectionLost)rr	�errrr)r�reasonrrr�connectionLost0s
z HalfCloseProtocol.connectionLost)�__name__�
__module__�__qualname__�__doc__rrrrrrrrr
s
	r
�__main__r��wb)r)rZ
__future__rr�sysZzope.interfacerZtwisted.internet.interfacesrZtwisted.internetrrZtwisted.pythonrr	ZProtocolr
rZnamedAny�argv�installZstartLogging�openrZ
StandardIO�run�exitrrrrr�<module>s $