Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 5
0
 def outCloseEvent(self):
     ProtocolWrapper.loseConnection(self)
Esempio n. 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)
Esempio n. 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)
Esempio n. 10
0
 def loseConnection(self):
     self.transport.write(b'c[3000,"Go away!"]')
     ProtocolWrapper.loseConnection(self)
Esempio n. 11
0
 def loseConnection(self):
     if not self.tlsStarted:
         ProtocolWrapper.loseConnection(self)
     else:
         AsyncStateMachine.setCloseOp(self)
Esempio n. 12
0
 def outReadEvent(self, data):
     if data == "":
         ProtocolWrapper.loseConnection(self)
     else:
         ProtocolWrapper.dataReceived(self, data)
Esempio n. 13
0
 def outCloseEvent(self):
     ProtocolWrapper.loseConnection(self)
Esempio n. 14
0
 def connectionMade(self):
     try:
         ProtocolWrapper.connectionMade(self)
     except TLSError, e:
         self.connectionLost(Failure(e))
         ProtocolWrapper.loseConnection(self)
Esempio n. 15
0
 def actuallyLoseConnection(self):
     ProtocolWrapper.loseConnection(self)
Esempio n. 16
0
 def outReadEvent(self, data):
     if data == "":
         ProtocolWrapper.loseConnection(self)
     else:
         ProtocolWrapper.dataReceived(self, data)
Esempio n. 17
0
 def loseConnection(self):
     if not self.tlsStarted:
         ProtocolWrapper.loseConnection(self)
     else:
         AsyncStateMachine.setCloseOp(self)
Esempio n. 18
0
 def loseConnection(self):
     self.transport.write('c[3000,"Go away!"]')
     ProtocolWrapper.loseConnection(self)
Esempio n. 19
0
 def loseConnection(self):
     # XXX Do we need to do m2.ssl_shutdown(self.ssl._ptr())?
     ProtocolWrapper.loseConnection(self)
Esempio n. 20
0
 def actuallyLoseConnection(self):
     ProtocolWrapper.loseConnection(self)