10Jan02=======================================================================
1. set SO_LINGER = 0 to try to prevent the system sending data on a closing
-socket. This MAY help some of the hanging problems.
+socket. This MAY help some of the hanging problems (but I am now beginning
+to doubt this).
2. do the same on the C client (which means DON'T FORGET to make it).
+3. set KEEPALIVE on TCP connections for both the node and C Client (you will
+have to make the C client again) and you will need to restart.
08Jan02=======================================================================
1. altered sh/qrz to point to the new server
2. alter the character set handling a bit to make it better for spanish
my ($l, $t) = unpack("ll", $buf);
dbg("Linger is: $buf = $l $t");
}
- setsockopt($conn->{sock}, SOL_SOCKET, SO_LINGER, pack("ll", 0, 0)) or confess "setsockopt: $!";
+ setsockopt($conn->{sock}, SOL_SOCKET, SO_LINGER, pack("ll", 0, 0)) or confess "setsockopt linger: $!";
+ setsockopt($conn->{sock}, SOL_SOCKET, SO_KEEPALIVE, 1) or confess "setsockopt keepalive: $!";
if (isdbg('sock') && ($buf = getsockopt($conn->{sock}, SOL_SOCKET, SO_LINGER))) {
my ($l, $t) = unpack("ll", $buf);
dbg("Linger is: $buf = $l $t");
struct hostent *hp, *gethostbyname();
struct sockaddr_in server;
int nodef;
+ int one = 1;
sel_t *sp;
struct linger 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);
}
+ if (setsockopt(nodef, SOL_SOCKET, SO_KEEPALIVE, &one, sizeof one) < 0) {
+ die("Error on SO_KEEPALIVE 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);