#NEWLINE# def _startRelay( self , client ) : #NEWLINE# #INDENT# 'Start relaying data between the process and the protocol.\n        This method is called when the protocol is connected.\n        ' #NEWLINE# process = process . transport . connector . process #NEWLINE# for ( _ , data ) in process . data : #NEWLINE# #INDENT# client . dataReceived ( data ) #NEWLINE# #UNINDENT# process . protocol = client #NEWLINE# @ process . _endedDeferred . addBoth #NEWLINE# def stopRelay( reason ) : #NEWLINE# #INDENT# 'Stop relaying data. Called when the process has ended.\n            ' #NEWLINE# relay = client . transport #NEWLINE# relay . loseConnection ( reason ) #NEWLINE# connector = relay . connector #NEWLINE# connector . connectionLost ( reason ) #NEWLINE# #UNINDENT# return client