mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-12 16:10:57 +00:00
A working plaintext 2.0 without validation
This commit is contained in:
@ -75,18 +75,6 @@ class TCP(ITransport):
|
||||
|
||||
reader, writer = await asyncio.open_connection(host, int(port))
|
||||
|
||||
# TODO: Change this `sending peer id` process to `/plaintext/2.0.0`
|
||||
# First: send our peer ID so receiver knows it
|
||||
writer.write(self_id.to_base58().encode())
|
||||
await writer.drain()
|
||||
|
||||
# Await ack for peer id
|
||||
expected_ack_str = "received peer id"
|
||||
ack = (await reader.read(len(expected_ack_str))).decode()
|
||||
|
||||
if ack != expected_ack_str:
|
||||
raise Exception("Receiver did not receive peer id")
|
||||
|
||||
return RawConnection(host, port, reader, writer, True)
|
||||
|
||||
def create_listener(self, handler_function: THandler) -> TCPListener:
|
||||
|
||||
Reference in New Issue
Block a user