Commit Graph

112 Commits

Author SHA1 Message Date
mhchia
5b03a7ad9f
Mplex: only close the send of new stream channel 2020-02-05 21:41:28 +08:00
mhchia
b7c2ec2187
Mplex: change the reference url
To the commit hash, to make it more correct.
2020-02-05 21:31:04 +08:00
mhchia
1fff6ad6b4
Mplex: change message channel size to 8
To avoid infinity sized channel, and to conform to the go
implementation.
2020-02-05 20:31:18 +08:00
mhchia
64c9c48dac
Mplex: change new stream channel size
To `0`, i.e. no unbuffered, to avoid growing buffer size.
2020-02-05 19:48:02 +08:00
mhchia
996b5cf15d
Mplex: catch exceptions from channel.send 2020-02-05 17:05:30 +08:00
mhchia
c0ab609559
Mplex: catch RawConnError when writing
Also, do nothing in `MplexStream.reset` if `MuxedConnUnavailable` is
raised when sending the message.
2020-02-04 21:57:59 +08:00
mhchia
e3a1dd62e4
Use new type hinting for trio channel 2020-01-26 23:56:19 +08:00
mhchia
5b4b65faa8
Change default value of read()
From `n = -1` to `n = None`, to comply with trio API
2020-01-26 23:03:38 +08:00
mhchia
eef241e70e
Make Mplex and SwarmConn not Service
After second thoughts, they seem not a good candidate of `Service`.
The shutdown logic becomes simpler by making them not `Service`.
2020-01-07 21:50:03 +08:00
mhchia
ce5663705f
Merge branch 'master' into feature/porting-to-trio 2019-12-24 02:19:43 +08:00
mhchia
fb0519129d
Refine Mplex.close and SwarmConn.close
Ensure `close` cleans up things and cancel the service finally.
2019-12-17 15:50:55 +08:00
mhchia
1929f307fb
Fix all modules except for security 2019-12-06 17:06:37 +08:00
mhchia
e9ab0646e3
Fix Pubsub 2019-12-03 17:27:49 +08:00
mhchia
eb494e8682
Fix ping protocol 2019-12-01 19:17:32 +08:00
mhchia
79fcdf3a02
Update tests in test_tcp.py
Besides, run `make format`
2019-12-01 16:26:16 +08:00
mhchia
1e600ea7e0
Fix Mplex and Swarm 2019-11-29 19:09:56 +08:00
mhchia
ec43c25b45
Rewrite factories, made some of the test running 2019-11-26 19:24:30 +08:00
Chih Cheng Liang
417b5e7d61
remove unused asyncio 2019-11-26 15:27:06 +08:00
Chih Cheng Liang
a397ccdc04
makes test_mplex_stream.py::test_mplex_stream_read_write work 2019-11-26 15:27:06 +08:00
Chih Cheng Liang
41ff884eef
rewrite tcp reader/writer interface 2019-11-26 15:27:05 +08:00
NIC619
19907e18ec
Replace (check and) del pattern with pop method 2019-11-20 23:06:37 +08:00
NIC619
c0522c1bd9
Check if entry exists in dictionary before delete 2019-11-17 21:52:05 +08:00
Alex Stokes
4b01c33d54
add some additional logging 2019-11-07 20:57:43 -08:00
Piper Merriam
ded3792924
Merge pull request #331 from dmuhs/fix/docs-format
Add automatic docstring formatting
2019-10-28 09:39:52 -06:00
Dominik Muhs
bafdd8512d Enforce pre-summary newline in docstrings 2019-10-24 20:10:45 +02:00
Dominik Muhs
5810174374 Rename stream muxer initiator flags 2019-10-24 19:28:19 +02:00
Dominik Muhs
031b98ddf0 Rename stream muxer initiator flags 2019-10-24 19:25:34 +02:00
Dominik Muhs
3db297fbee Fix mypy errors 2019-10-24 08:53:19 +02:00
Dominik Muhs
eef505f2d9 Add automatic docstring formatter and apply 2019-10-24 08:41:10 +02:00
NIC619
d52b093286
Fix mypy error 2019-10-18 15:59:35 +08:00
mhchia
82dc5d9e31
Ignore typing for asyncio.wait 2019-10-02 15:45:54 +08:00
mhchia
6f8394e4bd
Merge branch 'master' into fix/change-notifee-and-add-tests-for-swarm-conn-and-mplex 2019-09-21 18:34:12 +08:00
mhchia
539047be2d
Make mplex.read_message handle RawConnError 2019-09-21 18:17:00 +08:00
mhchia
e44c2145cc
Merge branch 'master' into fix/detection-of-close 2019-09-21 18:05:54 +08:00
mhchia
89c127eff4
Merge branch 'master' into fix/refactor-mplex-swarm-host 2019-09-20 15:45:28 +08:00
mhchia
02c55e5d14
Add tests for MplexConn 2019-09-19 16:31:42 +08:00
mhchia
a9ad37bc6f
Add mplex tests and fix error in SwarmConn.close 2019-09-19 16:31:41 +08:00
mhchia
5307c0506b
Change IMuxedConn to INetConn in Notifee 2019-09-19 16:31:41 +08:00
mhchia
5f064dd329
Refactor: get rid of single huge _handle_incoming 2019-09-19 15:55:27 +08:00
mhchia
4a689c7d57
Fix error when reset
If `Mplex` is cleanup first, `MplexStream.reset` possibly fails because
`Mplex.streams` is set to `None` in `cleanup`.
2019-09-19 15:55:27 +08:00
mhchia
b51c2939a8
Handle exceptions inside read_message
And remove the need of checking `None` for every read messages.
2019-09-19 15:55:26 +08:00
mhchia
f62f07bb9f
Handle IncompleteRead in handle_incoming 2019-09-19 15:55:26 +08:00
mhchia
2d8e02b7eb
Add detection for disconnections in mplex 2019-09-19 15:55:26 +08:00
mhchia
393b51a744
isort 2019-09-19 15:53:40 +08:00
mhchia
5653b3f604
Add "closed" and "shutting_down" events 2019-09-19 15:53:39 +08:00
mhchia
7cf0495f37
Remove print 2019-09-19 15:38:38 +08:00
mhchia
0bd213bbb7
Refactor mplex and start to add close detection 2019-09-19 13:56:05 +08:00
NIC619
559f419b4e
Fix stream registration in accept_stream 2019-09-17 15:42:18 +08:00
NIC619
76af835af8
Handle MultiselectError in stream_muxer.accept_stream 2019-09-15 17:35:01 +08:00
NIC619
879f193aa1
Handle errors from
- `read_delim`
    - `read_varint_prefixed_bytes`
    - `decode_uvarint_from_stream`
2019-09-15 16:58:08 +08:00