nervosnetwork / tentacle

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

fix: yamux session flush must once a loop #296

Closed driftluo closed 3 years ago

driftluo commented 3 years ago

ref: #288

This PR removes the flush command of the stream, because this command and the real message will squeeze each other, and the channel does not need the flush action in the actual sense. This means that the flush operation of the underlying io will be completely executed by the session.

There is no problem originally. Each poll executes a flush, but because the poll has a loop, the flush must be moved into the loop to be completely equivalent to a poll and a flush of other streams.