mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
Refine Mplex.close and SwarmConn.close
Ensure `close` cleans up things and cancel the service finally.
This commit is contained in:
@ -69,9 +69,8 @@ async def raw_conn_factory(
|
||||
tcp_transport = TCP()
|
||||
listener = tcp_transport.create_listener(tcp_stream_handler)
|
||||
await listener.listen(LISTEN_MADDR, nursery)
|
||||
listening_maddr = listener.multiaddrs[0]
|
||||
listening_maddr = listener.get_addrs()[0]
|
||||
conn_0 = await tcp_transport.dial(listening_maddr)
|
||||
print("raw_conn_factory")
|
||||
yield conn_0, conn_1
|
||||
|
||||
|
||||
|
||||
@ -39,3 +39,6 @@ def create_echo_stream_handler(
|
||||
await stream.write(resp.encode())
|
||||
|
||||
return echo_stream_handler
|
||||
|
||||
|
||||
# TODO: Service `external_api`
|
||||
|
||||
Reference in New Issue
Block a user