Пример #1
0
 def dataReceived(self, data):
     try:
         if not self.tlsStarted:
             ProtocolWrapper.dataReceived(self, data)
         else:
             self.fakeSocket.data += data
             while self.fakeSocket.data:
                 AsyncStateMachine.inReadEvent(self)
     except TLSError, e:
         self.connectionLost(Failure(e))
         ProtocolWrapper.loseConnection(self)
Пример #2
0
 def dataReceived(self, data):
     try:
         if not self.tlsStarted:
             ProtocolWrapper.dataReceived(self, data)
         else:
             self.fakeSocket.data += data
             while self.fakeSocket.data:
                 AsyncStateMachine.inReadEvent(self)
     except TLSError, e:
         self.connectionLost(Failure(e))
         ProtocolWrapper.loseConnection(self)
Пример #3
0
    def loseConnection(self):
        """
        Close the connection.

        This includes telling the other side we're closing the connection.

        If the other side didn't signal that the connection is being closed,
        then we might not see their last message, but since their last message
        should, according to the spec, be a simple acknowledgement, it
        shouldn't be a problem.
        """
        # Send a closing frame. It's only polite. (And might keep the browser
        # from hanging.)
        if not self.disconnecting:
            frame = _makeFrame("", _opcode=_CONTROLS.CLOSE)
            self.transport.write(frame)

            ProtocolWrapper.loseConnection(self)
Пример #4
0
    def loseConnection(self):
        """
        Close the connection.

        This includes telling the other side we're closing the connection.

        If the other side didn't signal that the connection is being closed,
        then we might not see their last message, but since their last message
        should, according to the spec, be a simple acknowledgement, it
        shouldn't be a problem.
        """
        # Send a closing frame. It's only polite. (And might keep the browser
        # from hanging.)
        if not self.disconnecting:
            frame = _makeFrame("", _opcode=_CONTROLS.CLOSE)
            self.transport.write(frame)

            ProtocolWrapper.loseConnection(self)
Пример #5
0
 def outCloseEvent(self):
     ProtocolWrapper.loseConnection(self)
Пример #6
0
 def connectionMade(self):
     try:
         ProtocolWrapper.connectionMade(self)
     except TLSError, e:
         self.connectionLost(Failure(e))
         ProtocolWrapper.loseConnection(self)
 def loseConnection(self):
     if debug:
         print 'TwistedProtocolWrapper.loseConnection'
     # XXX Do we need to do m2.ssl_shutdown(self.ssl._ptr())?
     ProtocolWrapper.loseConnection(self)
Пример #8
0
 def loseConnection(self):
     # XXX Do we need to do m2.ssl_shutdown(self.ssl._ptr())?
     ProtocolWrapper.loseConnection(self)
 def loseConnection(self):
     if debug:
         print 'TwistedProtocolWrapper.loseConnection'
     # XXX Do we need to do m2.ssl_shutdown(self.ssl._ptr())?
     ProtocolWrapper.loseConnection(self)
Пример #10
0
 def loseConnection(self):
     self.transport.write(b'c[3000,"Go away!"]')
     ProtocolWrapper.loseConnection(self)
Пример #11
0
 def loseConnection(self):
     if not self.tlsStarted:
         ProtocolWrapper.loseConnection(self)
     else:
         AsyncStateMachine.setCloseOp(self)
Пример #12
0
 def outReadEvent(self, data):
     if data == "":
         ProtocolWrapper.loseConnection(self)
     else:
         ProtocolWrapper.dataReceived(self, data)
Пример #13
0
 def outCloseEvent(self):
     ProtocolWrapper.loseConnection(self)
Пример #14
0
 def connectionMade(self):
     try:
         ProtocolWrapper.connectionMade(self)
     except TLSError, e:
         self.connectionLost(Failure(e))
         ProtocolWrapper.loseConnection(self)
Пример #15
0
 def actuallyLoseConnection(self):
     ProtocolWrapper.loseConnection(self)
Пример #16
0
 def outReadEvent(self, data):
     if data == "":
         ProtocolWrapper.loseConnection(self)
     else:
         ProtocolWrapper.dataReceived(self, data)
Пример #17
0
 def loseConnection(self):
     if not self.tlsStarted:
         ProtocolWrapper.loseConnection(self)
     else:
         AsyncStateMachine.setCloseOp(self)
Пример #18
0
 def loseConnection(self):
     self.transport.write('c[3000,"Go away!"]')
     ProtocolWrapper.loseConnection(self)
Пример #19
0
 def loseConnection(self):
     # XXX Do we need to do m2.ssl_shutdown(self.ssl._ptr())?
     ProtocolWrapper.loseConnection(self)
Пример #20
0
 def actuallyLoseConnection(self):
     ProtocolWrapper.loseConnection(self)