summaryrefslogtreecommitdiff
path: root/src/common/socket.c
diff options
context:
space:
mode:
authoramber <amber@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-26 19:44:00 +0000
committeramber <amber@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-26 19:44:00 +0000
commitd73cbd4c778f408ce3e06c57ad6418b99e2b9c51 (patch)
tree7e0eccf71218102b49424879e1ff6d8bf5ae05af /src/common/socket.c
parent23180e04bdb7a2dfb95da6fb6ab0026fb4ea8b0d (diff)
downloadhercules-d73cbd4c778f408ce3e06c57ad6418b99e2b9c51.tar.gz
hercules-d73cbd4c778f408ce3e06c57ad6418b99e2b9c51.tar.bz2
hercules-d73cbd4c778f408ce3e06c57ad6418b99e2b9c51.tar.xz
hercules-d73cbd4c778f408ce3e06c57ad6418b99e2b9c51.zip
updates
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@793 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common/socket.c')
-rw-r--r--src/common/socket.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/common/socket.c b/src/common/socket.c
index 0f5b53550..729f2fdfe 100644
--- a/src/common/socket.c
+++ b/src/common/socket.c
@@ -62,6 +62,10 @@ void set_defaultparse(int (*defaultparse)(int))
default_func_parse = defaultparse;
}
+void set_nonblocking(int fd, int yes) {
+ setsockopt(fd,IPPROTO_TCP,TCP_NODELAY,(char *)&yes,sizeof yes);
+}
+
static void setsocketopts(int fd)
{
int yes = 1; // reuse fix
@@ -70,7 +74,7 @@ static void setsocketopts(int fd)
#ifdef SO_REUSEPORT
setsockopt(fd,SOL_SOCKET,SO_REUSEPORT,(char *)&yes,sizeof yes);
#endif
- setsockopt(fd,IPPROTO_TCP,TCP_NODELAY,(char *)&yes,sizeof yes);
+ set_nonblocking(fd, yes);
setsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char *) &wfifo_size , sizeof(rfifo_size ));
setsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char *) &rfifo_size , sizeof(rfifo_size ));