enlarge backlog number

This commit is contained in:
Max Lv
2014-12-01 12:49:23 +08:00
parent 05d8e3f0c6
commit 1a94c7b68f
+5 -1
View File
@@ -64,6 +64,10 @@
#define BUF_SIZE 2048
#endif
#ifndef SSMAXCONN
#define SSMAXCONN 1024
#endif
static void signal_cb(EV_P_ ev_signal *w, int revents);
static void accept_cb(EV_P_ ev_io *w, int revents);
static void server_recv_cb(EV_P_ ev_io *w, int revents);
@@ -1088,7 +1092,7 @@ int main(int argc, char **argv)
if (listenfd < 0) {
FATAL("bind() error..");
}
if (listen(listenfd, SOMAXCONN) == -1) {
if (listen(listenfd, SSMAXCONN) == -1) {
FATAL("listen() error.");
}
setnonblocking(listenfd);