From: minima Date: Thu, 10 Jan 2002 17:34:28 +0000 (+0000) Subject: set SO_LINGER=0 X-Git-Tag: R_1_50~100 X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=ad126fcc09a303760f8a04cfec42ef43d9d3e66c;p=spider.git set SO_LINGER=0 --- diff --git a/src/client.c b/src/client.c index 5c2dd063..049d64f6 100644 --- a/src/client.c +++ b/src/client.c @@ -826,7 +826,8 @@ void connect_to_node() struct sockaddr_in server; int nodef; sel_t *sp; - + struct linger lg; + if ((hp = gethostbyname(node_addr)) == 0) die("Unknown host tcp host %s for printer", node_addr); @@ -842,6 +843,12 @@ void connect_to_node() if (connect(nodef, (struct sockaddr *) &server, sizeof server) < 0) { die("Error on connect to %s port %d (%d)", node_addr, node_port, errno); } + + memset(&lg, 0, sizeof lg); + if (setsockopt(nodef, SOL_SOCKET, SO_LINGER, &lg, sizeof lg) < 0) { + die("Error on SO_LINGER to %s port %d (%d)", node_addr, node_port, errno); + } + node = fcb_new(nodef, MSG); node->sp = sel_open(nodef, node, "Msg System", fcb_handler, MSG, SEL_INPUT);