TcpTransport initial implementation NetService#3
TcpTransport initial implementation NetService#3mikeyoung3k wants to merge 7 commits intoefimio16:mainfrom
Conversation
…16/Emittio into feature/net-service-trait
|
There are some pretty hefty flaws in this. For one, the listen function throws away any data received on other streams that didn't respond first. It would be much better to have every session start a new task once it's been established, that receives data, decrypts it, and puts it in a channel. Then listen should just pick off that channel |
|
@mikeyoung3k is attempting to deploy a commit to the yefimku-protonme's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Rewrote to make listen work properly. It now also gracefully handles the buffer being too small. PeerId info included in errors where relevant |
|
Thanks for the PR! In short, I liked how you implemented this task; you really dug into the cryptographic structures I’d implemented. So here’s what I think was done well:
And what could be improved to merge the commit:
But in general, it's really great, thanks for supporting the project. |
|
Thanks very much. I had initially used Will go and fix test bind. There are definitely some other tests that I'd like to do (caller hangs up before transmission ends - what error do we expect, e.g.) but on my to-do list next is see if I can go and contribute docs to Postcard because at the moment there aren't really any. |
|
Ah I do apologise, you're referring to the crate bytes? https://docs.rs/bytes/latest/bytes/struct.BytesMut.html |
|
Updated. Thanks for your comments |
Yes.
|
|
Sorry yes that won't overflow but if the buffer isn't big enough for the whole amount of data for a single serialised object then it will fail, so either we need to be very sure that the buffer will always be big enough for (at least) one object or it needs to be growable |
Some improvements to be made but an initial TcpTransport.
Given the trait had an add_session method which took an already fully established session, either TcpTransport or the trait (ideally the trait) needs a method to establish a new session - that's a todo