-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
read
on StreamHandle
returns UnexpectedEof
instead of Ok(0)
#360
Comments
poll_read
on streamhandle
returns unexpectedeof instead of Ok(0)
read
on StreamHandle
returns UnexpectedEof
instead of Ok(0)
我认为这应该是一个实现错误 Lines 315 to 318 in 19907a9
根据约定,这里应该返回 Ok(0)
|
或许可以在这里把状态切换到 https://github.com/nervosnetwork/tentacle/blob/master/yamux/src/stream.rs#L180-L190 接受pr吗?我晚点可以试试修一下。 |
看了下Spec和Go的实现,收到FIN后需要再发一个FIN回去,那应该在这里将 Line 318 in 19907a9
|
这个是错的,yamux 有半关状态,直接切换是不行的
当然接受,如果有兴趣的话可以尝试一下,需要带上一个测试用例,类似这个 Line 541 in 19907a9
对,修法很简单,将这个函数拆开,在 RemoteClosing 的分支直接返回 |
可能与 #205 有关。
我用
io::copy
转发数据,发现StreamHandle
在另一端调用shutdown
后read
总是返回一个unexpectedeof
,但Tokio的TcpStream
在这种情况下返回Ok(0)
,io::copy
也依赖该行为,是有意这样设计的吗?测试代码-yamux
测试代码-tokio
The text was updated successfully, but these errors were encountered: