コード例 #1
0
ファイル: fchat.py プロジェクト: forevertyping/python-flist
 def connectionLost(cl_self, reason):
     logger.debug("Connection closed with reason {reason}".format(reason=reason))
     self.client = None
     if self.pinger:
         self.pinger.stop()
     self.on_close()
     WebSocketClientProtocol.connectionLost(cl_self, reason)
コード例 #2
0
ファイル: client.py プロジェクト: arunenigma/rce
        def send(msg):
            binaries, jsonMsg = recursiveBinarySearch(msg)

            WebSocketClientProtocol.sendMessage(self, json.dumps(jsonMsg))

            for data in binaries:
                msg = data[0] + data[1].getvalue()
                WebSocketClientProtocol.sendMessage(self, msg, binary=True)
コード例 #3
0
    def _send(self, msg, binaries):
        """ Internally used method to send messages via WebSocket connection.
            Handles the actual sending of the message. (Not thread-safe; use
            sendMessage instead.)
        """
        WebSocketClientProtocol.sendMessage(self, msg)

        for data in binaries:
            binMsg = data[0] + data[1].getvalue()
            WebSocketClientProtocol.sendMessage(self, binMsg, binary=True)
コード例 #4
0
ファイル: client.py プロジェクト: PHPDOTSQL/rce
    def _send(self, msg, binaries):
        """ Internally used method to send messages via WebSocket connection.
            Handles the actual sending of the message. (Not thread-safe; use
            sendMessage instead.)
        """
        WebSocketClientProtocol.sendMessage(self, msg)

        for data in binaries:
            binMsg = data[0] + data[1].getvalue()
            WebSocketClientProtocol.sendMessage(self, binMsg, binary=True)
コード例 #5
0
   def connectionMade(self):
      FuzzingProtocol.connectionMade(self)
      WebSocketClientProtocol.connectionMade(self)

      self.caseAgent = self.factory.agent
      self.case = self.factory.currentCaseIndex
      self.Case = Cases[self.case - 1]
      self.runCase = self.Case(self)
      self.caseStarted = utcnow()
      print "Running test case ID %s for agent %s from peer %s" % (caseClasstoId(self.Case), self.caseAgent, self.peerstr)
コード例 #6
0
ファイル: fuzzing.py プロジェクト: abrandl/AutobahnTestSuite
 def connectionMade(self):
    FuzzingProtocol.connectionMade(self)
    WebSocketClientProtocol.connectionMade(self)
    self.caseStarted = utcnow()
    print "Running test case ID %s for agent %s from peer %s" % (self.factory.CaseSet.caseClasstoId(self.Case), self.caseAgent, self.peerstr)
コード例 #7
0
 def connectionLost(self, reason):
     print "connection lost"
     WebSocketClientProtocol.connectionLost(self, reason)
     self.factory.unregister(self)
     reactor.callLater(2, self.factory.connect)
コード例 #8
0
ファイル: client.py プロジェクト: frog32/status-monitor
 def sendMessage(self, payload):
     WebSocketClientProtocol.sendMessage(self, json.dumps(payload))
コード例 #9
0
 def sendMessage(self, payload, binary=False):
     session_id = self.session_id if hasattr(self, "session_id") else None
     now = round(1000000 * (time.clock() - self.factory.case.started))
     rec = (now, session_id, "TX", payload)
     self.factory.case.wampLog.append(rec)
     WebSocketClientProtocol.sendMessage(self, payload, binary)
コード例 #10
0
ファイル: command.py プロジェクト: davidblewett/gunny
 def onMessageFrameBegin(self, length, reserved):
     #log.msg('onMessageFrameBegin: %s' % length)
     WebSocketClientProtocol.onMessageFrameBegin(self, length, reserved)
     if self.frame_num == WSCP_DATA and self.buffer_filled is not None:
         self.file_decoders[self.path].registerProducer(self, True)
コード例 #11
0
ファイル: command.py プロジェクト: davidblewett/gunny
 def onMessageBegin(self, opcode):
     log.msg('onMessageBegin')
     WebSocketClientProtocol.onMessageBegin(self, opcode)
コード例 #12
0
ファイル: fuzzing.py プロジェクト: abrandl/AutobahnTestSuite
 def connectionLost(self, reason):
    WebSocketClientProtocol.connectionLost(self, reason)
    FuzzingProtocol.connectionLost(self, reason)
コード例 #13
0
ファイル: ws_test.py プロジェクト: Aerobota/rce
 def sendMessage(self, msg, binary, cb):
     assert self._cb is None
     self._cb = cb
     WebSocketClientProtocol.sendMessage(self, msg, binary)
コード例 #14
0
 def sendMessage(self, msg, binary, cb):
     assert self._cb is None
     self._cb = cb
     WebSocketClientProtocol.sendMessage(self, msg, binary)
コード例 #15
0
 def connectionLost(self,reason):
     self.factory.connections.remove(self)
     WebSocketClientProtocol.connectionLost(self, reason)#always after your code
     reactor.stop()
コード例 #16
0
 def connectionMade(self):
     WebSocketClientProtocol.connectionMade(self)#always before your code
     self.factory.connections.append(self)
コード例 #17
0
 def failHandshake(self, reason):
     """ This method is called by twisted when the connection could not be
         initialized.
     """
     print(reason)
     WebSocketClientProtocol.failHandshake(self, reason)
コード例 #18
0
ファイル: comm.py プロジェクト: LCROBOT/rce
 def failHandshake(self, reason):
     """ This method is called by twisted when the connection could not be
         initialized.
     """
     print(reason)
     WebSocketClientProtocol.failHandshake(self, reason)
コード例 #19
0
 def connectionLost(self, reason):
     print 'connection lost'
     WebSocketClientProtocol.connectionLost(self, reason)
     self.factory.unregister(self)
     reactor.callLater(2, self.factory.connect)