+
    Dfj                        R t ^ RIt^ RIHt ^ RIHtHt ^ RIHt ^ RI	H
t
Ht ]! ]4       ! R R]P                  4      4       t]R8X  d   ]P                  ! ]P                   ^,          4      P#                  4        ]
P$                  ! ]! ]P                   ^,          R	4      4       ^ R
IHt ]! 4       t]P,                  ! ]4       ]P.                  ! 4        ]P0                  ! ]P2                  4       R# R# )z
Main program for the child process run by
L{twisted.test.test_stdio.StandardInputOutputTests.test_readConnectionLost} to
test that IHalfCloseableProtocol.readConnectionLost works for stdio transports.
N)implementer)protocolstdio)IHalfCloseableProtocol)logreflectc                   @   a  ] tR t^t o RtRtR tR tR tR t	Rt
V tR# )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.
Nc                <    V P                   P                  R4       R# )z-
Signal the parent process that we're ready.
   xN)	transportwriteselfs   &C/usr/lib/python3/dist-packages/twisted/test/stdio_test_halfclose.pyconnectionMade HalfCloseProtocol.connectionMade   s     	T"    c                >    ^ V n         \        P                  ! 4        R# )z^
This is the desired event.  Once it has happened, stop the reactor so
the process will exit.
N)exitCodereactorstopr   s   &r   readConnectionLost$HalfCloseProtocol.readConnectionLost%   s    
 r   c                    V P                   f   ^V n         \        P                  ! VR4       \        P                  ! 4        R# )zt
This may only be invoked after C{readConnectionLost}.  If it happens
otherwise, mark it as an error and shut down.
Nz!Unexpected call to connectionLost)r   r   errr   r   )r   reasons   &&r   connectionLost HalfCloseProtocol.connectionLost-   s-    
 == DMGGF?@r   c                    R # )N r   s   &r   writeConnectionLost%HalfCloseProtocol.writeConnectionLost7   s    r   )r   )__name__
__module____qualname____firstlineno____doc__r   r   r   r   r!   __static_attributes____classdictcell__)__classdict__s   @r   r	   r	      s*      H# r   r	   __main__wb)r   )r'   syszope.interfacer   twisted.internetr   r   twisted.internet.interfacesr   twisted.pythonr   r   Protocolr	   r#   namedAnyargvinstallstartLoggingopenr   halfCloseProtocol
StandardIOrunexitr   r    r   r   <module>r<      s   
  & , > ' #$#)) # %#L zSXXa[!))+T#((1+t,-()+	&'KKMHH''( r   