MCPcopy Index your code
hub / github.com/RustPython/RustPython / ClientProtoFirst

Class ClientProtoFirst

Lib/test/test_asyncio/test_sslproto.py:444–458  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

442 sock.close()
443
444 class ClientProtoFirst(asyncio.BufferedProtocol):
445 def __init__(self, on_data):
446 self.on_data = on_data
447 self.buf = bytearray(1)
448
449 def connection_made(self, tr):
450 nonlocal client_con_made_calls
451 client_con_made_calls += 1
452
453 def get_buffer(self, sizehint):
454 return self.buf
455
456 def buffer_updated(slf, nsize):
457 self.assertEqual(nsize, 1)
458 slf.on_data.set_result(bytes(slf.buf[:nsize]))
459
460 class ClientProtoSecond(asyncio.Protocol):
461 def __init__(self, on_data, on_eof):

Callers 1

clientMethod · 0.70

Calls

no outgoing calls

Tested by 1

clientMethod · 0.56