Closed abel-von closed 4 years ago
use control to open a new stream on the async way https://github.com/nervosnetwork/tentacle/blob/master/yamux/src/session.rs#L259 https://github.com/nervosnetwork/tentacle/blob/master/yamux/src/control.rs#L23
I didn't notice that the control can open stream asynchronouly, Thank you very much. @driftluo
Hi, I'm trying to use the tokio-yamux in my project, but i have encountered a problem.
in the example i can find the codes below
I know this is like an engine for client to send the message out. but this session is moved to the async block, and we can not use it anymore. so all the streams of this session should be opened before spawn the async block.
but in my senario, the yamux client is a proxy, the stream is opened based on the new connection coming to the proxy, so I can not open all streams before spawn the async block. I tried to workaround by calling other methods in session to make sure the events of client be sent out. but i found that only calling next() can the client send events out.
So is there any way to solve my issue?
thanks very much