MCPcopy Create free account
hub / github.com/ActiveState/code / recvfrom

Method recvfrom

recipes/Python/572159_SPICE/recipe-572159.py:191–204  ·  view source on GitHub ↗

Receive datagram and decrypt off socket.

(self, size, flags=0)

Source from the content-addressed store, hash-verified

189 return _decode(string, self.__dm1, self.__dm2)
190
191 def recvfrom(self, size, flags=0):
192 'Receive datagram and decrypt off socket.'
193 string, address = self.__socket.recvfrom(size * 4, flags)
194 string = self.__tails.get(address, '') + string
195 tail_len = len(string) % 4
196 if tail_len:
197 self.__tails[address] = string[-tail_len:]
198 string = _decode(string[:-tail_len], self.__dm1, self.__dm2)
199 return string, address
200 else:
201 if address in self.__tails:
202 del self.__tails[address]
203 string = _decode(string, self.__dm1, self.__dm2)
204 return string, address
205
206 def send(self, string, flags=0):
207 'Encrypt and send on socket.'

Callers 9

recipe-491264.pyFile · 0.45
recipe-442490.pyFile · 0.45
get_current_SNTP_timeFunction · 0.45
recipe-117211.pyFile · 0.45
runMethod · 0.45
recvMethod · 0.45
recipe-578802.pyFile · 0.45
sntp_timeFunction · 0.45
recipe-52218.pyFile · 0.45

Calls 2

_decodeFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected