def _finishIncoming(self, incomingSocket, fromRealAddr):
        # Only called if incomingSocket can continue to be used; if
        # there was an error then incomingSocket should be closed and
        # released.
        fromAddr = incomingSocket.fromAddress
        if fromAddr and isinstance(incomingSocket, TCPIncomingPersistent):
            if fromAddr in self._openSockets:

                _safeSocketShutdown(self._openSockets[fromAddr].socket)
            self._openSockets[fromAddr] = IdleSocket(incomingSocket.socket)
            for T in self._transmitIntents.values():
                if T.targetAddr == fromAddr and T.stage == self._XMITStepRetry:
                    T.retry(immediately=True)
                    # This intent will be picked up on the next
                    # timeout check in the main loop and
                    # processed; by waiting for main loop
                    # processing, fairness with read handling is
                    # allowed.
                    break
        else:
            incomingSocket.close()
        return None
dataset/ETHPy150Open godaddy/Thespian/thespian/system/transport/TCPTransport.py/TCPTransport._finishIncoming/original