Improved stream IDs

This commit is contained in:
Robert Zajac
2018-11-25 11:05:56 -05:00
parent 5548041a37
commit 592ef69d8d
2 changed files with 13 additions and 6 deletions

View File

@ -59,9 +59,7 @@ class Swarm(INetwork):
# Use muxed conn to open stream, which returns
# a muxed stream
# TODO: use better stream IDs
stream_id = (uuid.uuid4().int & (1<<64)-1) >> 3
muxed_stream = muxed_conn.open_stream(protocol_id, stream_id, peer_id, multiaddr)
muxed_stream = await muxed_conn.open_stream(protocol_id, peer_id, multiaddr)
# Create a net stream
net_stream = NetStream(muxed_stream)