From fd3eae68b54c5d466f5cbcc984ba1a80ae302bbf Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 11 Apr 2004 16:48:32 +0000 Subject: grr :p git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@532 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/connection.cpp | 8 +++++--- 1 file 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 { -- cgit v1.2.3