diff options
author | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-06-18 04:54:20 +0800 |
---|---|---|
committer | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-06-18 04:54:20 +0800 |
commit | 6eed5faa477f64818190b7220cd9ad7a138cc319 (patch) | |
tree | 6d22f88ccff0ceb48a784b84df07ce851cf60240 /mbbsd/mbbsd.c | |
parent | 2f280d2b0da709c2b6055f1309b5358f47e81260 (diff) | |
download | pttbbs-6eed5faa477f64818190b7220cd9ad7a138cc319.tar pttbbs-6eed5faa477f64818190b7220cd9ad7a138cc319.tar.gz pttbbs-6eed5faa477f64818190b7220cd9ad7a138cc319.tar.bz2 pttbbs-6eed5faa477f64818190b7220cd9ad7a138cc319.tar.lz pttbbs-6eed5faa477f64818190b7220cd9ad7a138cc319.tar.xz pttbbs-6eed5faa477f64818190b7220cd9ad7a138cc319.tar.zst pttbbs-6eed5faa477f64818190b7220cd9ad7a138cc319.zip |
experiment on setting socket recving buffer size to 1kb
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2070 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/mbbsd.c')
-rw-r--r-- | mbbsd/mbbsd.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c index f96f5eff..be7b32e7 100644 --- a/mbbsd/mbbsd.c +++ b/mbbsd/mbbsd.c @@ -1235,7 +1235,7 @@ getremotename(struct sockaddr_in * from, char *rhost, char *rname) static int bind_port(int port) { - int sock, on; + int sock, on, sz; sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); @@ -1246,6 +1246,9 @@ bind_port(int port) on = 0; setsockopt(sock, SOL_SOCKET, SO_LINGER, (char *)&on, sizeof(on)); + sz = 1024; + setsockopt(sock, SOL_SOCKET, SO_RCVBUF, (void*)&sz, sizeof(sz)); + xsin.sin_port = htons(port); if (bind(sock, (struct sockaddr *) & xsin, sizeof xsin) < 0) { syslog(LOG_INFO, "bbsd bind_port can't bind to %d", port); |