MCPcopy Index your code
hub / github.com/bslatkin/effectivepython / FakeSocket

Class FakeSocket

example_code/item_099.py:137–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135
136print("Example 6")
137class FakeSocket:
138
139 def recv(self, size):
140 return video_view[byte_offset : byte_offset + size]
141
142 def recv_into(self, buffer):
143 source_data = video_view[byte_offset : byte_offset + size]
144 buffer[:] = source_data
145
146socket = ... # socket connection to the client
147video_cache = ... # Cache of incoming video stream

Callers 1

item_099.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected