After every 10 minutes waiting servers and waiting client are disconnected.
do_repeater_wait in in socket_functions.cpp outputs to log
recv -1
I added printout after that and found that error was
It looks like after every 10 minutes sockets are destroyed, socket handles become invalid and recv returns this error.10038 An operation was attempted on something that is not a socket.
I added timeouts printouts after socket creation using procedure below.
This prints out 0 so it looks like socket timeouts are infinite.
I tried ultravnc server running in same computer as repeater and enabled keepalive. This server gots also disconnected so it looks like this is not router issue.
How to fix it ro find reason of socket disconnection?
Code: Select all
static void veateade_TIMEO(char *txt, SOCKET sock)
{
// code from http://www.cs.cmu.edu/afs/cs/academic/class/15213-f00/unpv12e/sock/sockopts.c
struct timeval timer;
int optLen = sizeof(timer);
timer.tv_sec = timer.tv_usec = 0;
optLen = sizeof(timer);
if (getsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, (char *)&timer, &optLen) != 0)
debug("veateade_TIMEO(SO_RCVTIMEO): ");
else
debug("veateade_TIMEO() => SO_RCVTIMEO = %ld.%06ld\n", timer.tv_sec, timer.tv_usec);
timer.tv_sec = timer.tv_usec = 0;
optLen = sizeof(timer);
if (getsockopt(sock, SOL_SOCKET, SO_SNDTIMEO, (char *)&timer, &optLen) != 0)
debug("veateade_TIMEO(SO_SNDTIMEO): ");
else
debug("veateade_TIMEO() => SO_SNDTIMEO = %ld.%06ld\n", timer.tv_sec, timer.tv_usec);
}