Example #1
0
 def readConnectionLost(self, reason):
     p = interfaces.IHalfCloseableProtocol(self.protocol, None)
     if p:
         try:
             p.readConnectionLost()
         except:
             log.err()
             self.connectionLost(failure.Failure())
     else:
         self.connectionLost(reason)
Example #2
0
 def _closeWriteConnection(self):
     try:
         getattr(self.socket, self._socketShutdownMethod)(1)
     except socket.error:
         pass
     p = interfaces.IHalfCloseableProtocol(self.protocol, None)
     if p:
         try:
             p.writeConnectionLost()
         except:
             f = failure.Failure()
             log.err()
             self.connectionLost(f)
Example #3
0
    def _writeConnectionLost(self, reason):
        self._writer = None
        if self.disconnecting:
            self.connectionLost(reason)
            return

        p = interfaces.IHalfCloseableProtocol(self.protocol, None)
        if p:
            try:
                p.writeConnectionLost()
            except:
                log.err()
                self.connectionLost(failure.Failure())