def _nextTransmitStepCheck(self, intent, fileno, closed=False):
        # Return True if this intent is still valid, False if it has
        # been completed.  If fileno is -1, this means check if there is
        # time remaining still on this intent
        if self._socketFile(intent) == fileno or \
           (fileno == -1 and intent.timeToRetry(hasattr(self, '_openSockets') and
                                                intent.targetAddr in self._openSockets)):
            if closed:
                intent.stage = self._XMITStepRetry
            return self._nextTransmitStep(intent)
        if intent.expired():
            # Transmit timed out (consider this permanent)
            thesplog('Transmit attempt from %s to %s timed out, returning PoisonPacket',
                     self.myAddress, intent.targetAddr, level=logging.WARNING)
            #self._incomingEnvelopes.append(ReceiveEnvelope(intent.targetAddr,
            #                                               PoisonPacket(intent.message)))
            # Stop attempting this transmit
            return self._finishIntent(intent, SendStatus.Failed)
        # Continue to attempt this transmit
        if not intent.delay():
            return self._nextTransmitStep(intent)
        return True
dataset/ETHPy150Open godaddy/Thespian/thespian/system/transport/TCPTransport.py/TCPTransport._nextTransmitStepCheck/original