MCPcopy Index your code
hub / github.com/python/cpython / ClientProtoFirst

Class ClientProtoFirst

Lib/test/test_asyncio/test_sslproto.py:442–456  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

clientMethod · 0.70

Calls

no outgoing calls

Tested by 1

clientMethod · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…