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)
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)
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)
def sendMessage(self, payload): WebSocketClientProtocol.sendMessage(self, json.dumps(payload))
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)
def sendMessage(self, msg, binary, cb): assert self._cb is None self._cb = cb WebSocketClientProtocol.sendMessage(self, msg, binary)
def sendMessage(self, msg, binary, cb): assert self._cb is None self._cb = cb WebSocketClientProtocol.sendMessage(self, msg, binary)