Skip to content
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

[INFO] About sokit UDP connections timeout feature #6

Open
JiapengLi opened this issue Dec 1, 2016 · 0 comments
Open

[INFO] About sokit UDP connections timeout feature #6

JiapengLi opened this issue Dec 1, 2016 · 0 comments

Comments

@JiapengLi
Copy link

JiapengLi commented Dec 1, 2016

To help someone who is curious about why UDP connection lost.

The sokit use a timer to detect whether the UDP connection is lost, if there is no data communication over a UDP connection more than 2min. Sokit will remove the UDP connection from the list.

Related code:

e041ccb : src/sokit/serverskt.cpp line 334

m_timer.start(2000);

e041ccb : src/sokit/serverskt.cpp line 435

void ServerSktUdp::check()
{
	QStringList list;
	getKeys(list);

	while (!list.isEmpty())
	{
		QString k = list.takeFirst();

		void* c = getCookie(k);

		if (c && (((Conn*)c)->stamp.addSecs(120) < QDateTime::currentDateTime()))
		{
			close(c);
			unsetCookie(k);
		}
	}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant