Commit Graph

13 Commits

Author SHA1 Message Date
mhchia
95ae718e3d
Raise ParseError in read_delim 2019-09-23 16:01:22 +08:00
NIC619
7fc958e7be
Add exception raised to docstring 2019-09-19 22:19:36 +08:00
NIC619
c6294ad19b
Raise MultiselectCommunicatorError:
when failed to write to communicator
2019-09-19 21:51:23 +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
mhchia
10415cb956
Use ReadWriteCloser for conns and streams 2019-09-05 23:24:17 +08:00
mhchia
ef476e555b
Use RawConnection.read
Instead of accessing its reader and writer directly.

TODO: considering add `ReaderWriterCloser` interface and let connection
and stream inherit from it.
2019-08-22 22:53:48 +08:00
mhchia
0b466ddc86
Add lock to RawConnection
To avoid `self.writer.drain()` is called in parallel.
Reference: https://bugs.python.org/issue29930
2019-08-22 22:53:47 +08:00
mhchia
a0923d202a
Move varint and delim read/write to toplevel
To `libp2p.utils`.
2019-08-22 22:53:46 +08:00
mhchia
86d4ce1da8 Add delim_encode and delim_read
- Add `StreamCommunicator` and `RawConnectionCommunicator`, read/write
messages with delim codec, with `IMuxedStream` and `IRawConnection`
respectively.
- Use it in `Multiselect` and `MultiselectClient`.
2019-08-18 19:51:04 +08:00
Chih Cheng Liang
dbb702548f add NegotiableTransport type 2019-08-08 16:09:02 +08:00
Chih Cheng Liang
5903012e0e add typing to protocol_muxer 2019-08-08 16:09:02 +08:00
Stuckinaboot
867f3a70f6 Modify stream to be reader_writer 2019-05-07 01:31:54 -04:00
Alexander Koshkin
ce6ddb27a9 Migrate to new project structure. 2019-01-09 21:38:56 +03:00