MCPcopy
hub / github.com/XX-net/XX-Net / flush

Method flush

code/default/lib/noarch/tlslite/messagesocket.py:108–125  ·  view source on GitHub ↗

Empty the queue of messages to write Will fragment the messages and write them in as little records as possible. :rtype: generator

(self)

Source from the content-addressed store, hash-verified

106 return res
107
108 def flush(self):
109 """
110 Empty the queue of messages to write
111
112 Will fragment the messages and write them in as little records as
113 possible.
114
115 :rtype: generator
116 """
117 while len(self._sendBuffer) > 0:
118 recordPayload = self._sendBuffer[:self.recordSize]
119 self._sendBuffer = self._sendBuffer[self.recordSize:]
120 msg = Message(self._sendBufferType, recordPayload)
121 for res in self.sendRecord(msg):
122 yield res
123
124 assert len(self._sendBuffer) == 0
125 self._sendBufferType = None
126
127 def flushBlocking(self):
128 """Blocking variant of :py:meth:`flush`."""

Callers 15

flushBlockingMethod · 0.95
queueMessageMethod · 0.95
sendMessageMethod · 0.95
handle_one_requestMethod · 0.45
logMethod · 0.45
_SOCKS5_requestMethod · 0.45
_negotiate_SOCKS4Method · 0.45
print_Function · 0.45
_sendErrorMethod · 0.45
_sendMsgsMethod · 0.45
_clientResumeMethod · 0.45
_clientFinishedMethod · 0.45

Calls 2

MessageClass · 0.85
sendRecordMethod · 0.80

Tested by 1

start_xxnetMethod · 0.36