diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2004-04-11 16:48:32 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2004-04-11 16:48:32 +0000 |
commit | fd3eae68b54c5d466f5cbcc984ba1a80ae302bbf (patch) | |
tree | 05ad6c8d512eaec209913b6c83a1275d62997f10 /src | |
parent | 1a0fe0eeeec8926a1e0777ea214960c4a8c205ab (diff) |
grr :p
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@532 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/connection.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/connection.cpp b/src/connection.cpp index 3adaf0d08..5b593667b 100644 --- a/src/connection.cpp +++ b/src/connection.cpp @@ -149,20 +149,22 @@ bool connection::SendPacket(char *message, char* host, int port, long ourkey) // this MUST operate in lock/step fashion!!! int cycles = 0; packet p2; - while ((recvfrom(fd,&p2,sizeof(p2),0,(sockaddr*)&host_address,&host_address_size)<0) && (cycles < 10)) + do { fd_set sfd; timeval tval; - tval.tv_usec = 100; + tval.tv_usec = 1000; tval.tv_sec = 0; FD_ZERO(&sfd); FD_SET(fd,&sfd); int res = select(65535, &sfd, NULL, NULL, &tval); cycles++; } + while ((recvfrom(fd,&p2,sizeof(p2),0,(sockaddr*)&host_address,&host_address_size)<0) && (cycles < 10)) + if (cycles >= 10) { - log(DEFAULT,"ERROR! connection::SendPacket() waited >1000 nanosecs for an ACK. Will resend up to 5 times"); + log(DEFAULT,"ERROR! connection::SendPacket() waited >10000 nanosecs for an ACK. Will resend up to 5 times"); } else { |