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
问题描述:A发送文件给B,同时C发送文件给D,其中任何一组发送完成都会导致fileserver服务崩溃。 问题原因:FileServer::onDisconnected 函数逻辑错误,任何会话完成传输都会清理掉其他会话。 我的解决方法:
void FileServer::onDisconnected(const std::shared_ptr<TcpConnection>& conn) { std::lock_guard<std::mutex> guard(m_sessionMutex); for (auto iter = m_sessions.begin(); iter != m_sessions.end(); ++iter) { if ((*iter)->getConnectionPtr() == NULL) { LOGE("connection is NULL"); continue; } if ((*iter)->getConnectionPtr() == conn) { //用户下线 m_sessions.erase(iter); //bUserOffline = true; LOGI("client disconnected: %s", conn->peerAddress().toIpPort().c_str()); break; } } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
问题描述:A发送文件给B,同时C发送文件给D,其中任何一组发送完成都会导致fileserver服务崩溃。
问题原因:FileServer::onDisconnected 函数逻辑错误,任何会话完成传输都会清理掉其他会话。
我的解决方法:
The text was updated successfully, but these errors were encountered: