nervosnetwork / tentacle

A multiplexed p2p network framework that supports custom protocols
https://docs.rs/tentacle
MIT License
54 stars 24 forks source link

fix: fix session proto open/close by user part #220

Closed driftluo closed 4 years ago

driftluo commented 4 years ago

This is a long-established bug that only affects the manual opening of the user's protocol at the session-level.

There's a logical confusion here, the handle doesn't need to be open every time it's open, because the session is already resident when it's open. The handle does not need to be removed when the protocol is closed alone, but only when the session is closed.

Now, with the addition of a test case here.