Commit Graph

35 Commits

Author SHA1 Message Date
31fb4e0b69 Rewrite _wait_for_data, to handle task precisely
Make the futures first, and then we can compare them with the return
value from `asyncio.wait`.
2019-09-10 23:38:45 +08:00
df87f5adb9 Add tests against the daemon for close/reset 2019-09-10 18:01:16 +08:00
e5eb01d22b Fix stream read 2019-09-10 18:01:16 +08:00
df312f3e57 Fix linting 2019-09-10 18:01:15 +08:00
be2c0f122a Fix close behavior 2019-09-10 18:01:14 +08:00
6c1f77dc1a Fix: Change the event.close to event.set
And add missing parts.
2019-09-06 21:35:15 +08:00
649a230776 Fix MplexStream.read 2019-09-06 17:26:40 +08:00
95926b7376 Temp for mplex_stream 2019-09-06 01:08:42 +08:00
eac159c527 Restructure mplex and mplex_stream 2019-09-05 22:29:33 +08:00
96230758e4 Add events in MplexStream
And modify a little bit of `close` and `reset`
2019-09-05 18:18:39 +08:00
d35b8ffc64 Conform stream_id to go-mplex 2019-08-28 21:43:34 +08:00
a193ae81fd Fix typo w/ header tag under different reset scenarios 2019-08-26 11:39:30 -07:00
d59870ebbf Fix MplexStream error
When receiving a `NewStream`, the message of that packet is the
name of the stream, which should be handled, rather than letting it go
into the message queue.
2019-08-26 20:39:08 +08:00
c5f32bf431 PR feedback for MplexStream.read 2019-08-16 11:03:16 +08:00
8699568d43 Update libp2p/stream_muxer/mplex/mplex_stream.py
Co-Authored-By: Alex Stokes <r.alex.stokes@gmail.com>
2019-08-16 11:03:16 +08:00
b27cd0f24f Use bytearray over bytes
To avoid copies.
2019-08-16 11:03:16 +08:00
f281e3e1db flake8 2019-08-16 11:03:16 +08:00
9f8276fa84 Support read(n=-1)
Now, `n=-1` indicates that we want to read until EOF. However, now we
only read until we have no new message.
2019-08-16 11:03:16 +08:00
9cb6ec1c48 Modify the behavior of MplexStream.read 2019-08-16 11:03:16 +08:00
2485a00e24 Modify NetStream to read n bytes 2019-08-16 11:03:16 +08:00
3debd2c808 Run black and isort w/ the new config 2019-08-13 14:36:42 -07:00
cb3a59e0ac ttl as int 2019-08-05 17:02:18 +08:00
e763f57930 run isort 2019-08-05 11:47:23 +08:00
7a04ebb51f run black 2019-08-05 11:21:20 +08:00
9e0a806218 move stream and connection interfaces to abc 2019-08-05 11:17:38 +08:00
87ef2e4618 remove if TYPE_CHECKING as much as possible 2019-08-05 10:46:49 +08:00
4c9a930f84 stream_muxer done 2019-08-05 10:45:47 +08:00
239a5c88fb add typing to mplex 2019-08-05 10:45:46 +08:00
36b7e8ded9 Refactor HeaderTags 2019-08-05 10:45:46 +08:00
7477b29508 run black w/ extended line length 2019-08-04 12:37:41 +08:00
2e94fcf56c Remove pylint:disable 2019-08-02 23:26:06 +08:00
0ae9840928 Run black over repo 2019-07-31 15:00:12 -07:00
e53727d301 Apply PR feedback: fix type hints 2019-07-30 16:28:25 +08:00
82840b5e6c Stream rearchitecture (#126)
* Add generic protocol handler

* Add generic protocol handler to stream muxing pipeline

* Modify conn_handler to only deal with connections

* mplex accept stream architecture changes

* Add create generic protocol handler

* Fix minor bugs

* who would win 4 devs or one not

* Debugging

* rearch with handle_incoming infinite loop, seems to work, needs cleanup"

* passing linting, still needs cleanup

* fixing linting again; code still needs cleanup

* fixing tests; code still needs cleanup

* adding test cleanup and task cleanup, removing prints

* linting, and cleanup complete

* storing connections based on peer id

* remove dead code

* remove unnecessary peer_id
2019-02-24 20:58:23 -05:00
ce6ddb27a9 Migrate to new project structure. 2019-01-09 21:38:56 +03:00