We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
server模式下, 循环不结束,是否应该添加 input_rx.recv() 失败时结束循环?
let io_task_handle = { let session = session.clone(); tokio::spawn(async move { let mut input_buffer = [0u8; 65536];
loop { tokio::select! { recv_result = udp_socket.recv(&mut input_buffer), if is_client => { ... } // bytes received from listener socket input_opt = input_rx.recv() => { ... } else { // 这里结束循环??? break; } } } } }) };
The text was updated successfully, but these errors were encountered:
这里返回 None 的前提应该是 input_tx 析构,或者调用了 close(),目前的实现应该都不可能,因为 KcpSession 不会析构。
None
input_tx
close()
KcpSession
tokio_kcp/src/session.rs
Line 240 in 89979a8
KcpSession 退出的条件是这里
Sorry, something went wrong.
@zonyitoo
意思是长时间运行会有大量KcpSession泄漏吗
@zonyitoo 意思是长时间运行会有大量KcpSession泄漏吗
如果 expire设置为了 0,长时间运行,sessions结构确实会越来越大,这是 UDP 特性导致的
No branches or pull requests
server模式下, 循环不结束,是否应该添加 input_rx.recv() 失败时结束循环?
let io_task_handle = {
let session = session.clone();
tokio::spawn(async move {
let mut input_buffer = [0u8; 65536];
The text was updated successfully, but these errors were encountered: