From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96078617110385.tru64-unix-managers.marc@archive.invalid> From: Tonny Madsen Date: Mon, 15 Sep 1997 09:33:55 +0000 To: tru64-unix-managers Subject: Using SO_KEEPALIVE under Digital UNIX 3.2g X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96078617110385 Hi' I have a problem with TCP/IP keep-alive messages under Digital UNIX 3.2g and I wondered if anybody knows of any errors and/or problems with these. I have a very small test program (seen below) that simply creates a socket, sets the SO_KEEPALIVE option and connnect to another machine (named balder) on our local network. But when I try to run this program (effectively as 'sock balder telnet') I get the following output from tcpdump: tma@modi$ tcpdump 'host balder and port telnet' tcpdump: listening on tu0 Using kernel BPF filter 11:20:51.705648 modi.2537 > balder.telnet: S 1121408000:1121408000(0) win 32768 11:20:51.706624 balder.telnet > modi.2537: S 1409261036:1409261036(0) ack 1121408001 win 8760 (DF) 11:20:51.706624 modi.2537 > balder.telnet: . ack 1 win 33580 11:20:51.784704 balder.telnet > modi.2537: P 1:16(15) ack 1 win 8760 (DF) 11:20:51.963888 modi.2537 > balder.telnet: . ack 16 win 33565 No keep-alive messages are seen for 1000 seconds. So my questions are: are there any problems with SO_KEEPALIVE under Digital UNIX 3.2g? Is it implemented at all? /tonny ------------------------------------------------------------ #include #include #include #include #include #include // Socket stuff #include // inet_ntoa and friends int main(int argc, char *argv[]) { int fd; int ret; int sock_opt; sockaddr_in ipaddr; assert(argc >= 3); fd = socket(AF_INET, SOCK_STREAM, 0); assert(fd >= 0); sock_opt = 1; ret = setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, (caddr_t)&sock_opt, sizeof(sock_opt)); assert(ret >= 0); ipaddr.sin_family = AF_INET; ipaddr.sin_addr.s_addr = inet_addr(argv[1]); ipaddr.sin_port = htons(atoi(argv[2])); ret = connect(fd, (sockaddr*)&ipaddr, sizeof(ipaddr)); assert(ret >= 0); sleep(1000); } ------------------------------------------------------------