[Freeciv-Dev] [PATCH] make accepting new connects nonblocking
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
I've run freeciv with profiler.
There seems to be some kind of problem with connecting clients.
Sometimes I have to connect and disconnect several times before
games starts to run.
This patch fixes the problem, but I'm not sure it fixes problem
at freeciv or at glibc / socket implementation.
My system is linux 2.2.14, RH6.1, glibc 2.1.2.
--
//Markus
Index: server/sernet.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/sernet.c,v
retrieving revision 1.31
diff -u -r1.31 sernet.c
--- sernet.c 2000/01/02 11:32:16 1.31
+++ sernet.c 2000/02/09 09:14:11
@@ -56,6 +56,7 @@
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
+#include <fcntl.h>
#include "log.h"
#include "packets.h"
@@ -243,8 +244,8 @@
fromlen = sizeof fromend;
+ fcntl(sockfd, F_SETFL, O_NONBLOCK);
new_sock = accept(sockfd, (struct sockaddr *) &fromend, &fromlen);
-
from=gethostbyaddr((char*)&fromend.sin_addr,
sizeof(sizeof(fromend.sin_addr)),
AF_INET);
- [Freeciv-Dev] [PATCH] make accepting new connects nonblocking,
Markus Linnala <=
|
|