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

Method recv

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

Receive and decrypt off socket.

(self, size, flags=0)

Source from the content-addressed store, hash-verified

178 return Socket_Crypt(self.__major, self.__minor, conn), address
179
180 def recv(self, size, flags=0):
181 'Receive and decrypt off socket.'
182 string = self.__tail + self.__socket.recv(size * 4, flags)
183 tail_len = len(string) % 4
184 if tail_len:
185 self.__tail = string[-tail_len:]
186 return _decode(string[:-tail_len], self.__dm1, self.__dm2)
187 else:
188 self.__tail = ''
189 return _decode(string, self.__dm1, self.__dm2)
190
191 def recvfrom(self, size, flags=0):
192 'Receive datagram and decrypt off socket.'

Callers 1

readMethod · 0.95

Calls 1

_decodeFunction · 0.70

Tested by

no test coverage detected