X-Git-Url: https://gapil.gnulinux.it/gitweb/?a=blobdiff_plain;f=listati%2FTCP_echo_sixth.c;fp=listati%2FTCP_echo_sixth.c;h=1ece02b5d45b23a559cc12639b21620a0b050817;hb=1baec6cc784670c341381e058c8a12439641012c;hp=0000000000000000000000000000000000000000;hpb=0533192662934e0137c96f09c11ecc8d08a9131a;p=gapil.git diff --git a/listati/TCP_echo_sixth.c b/listati/TCP_echo_sixth.c new file mode 100644 index 0000000..1ece02b --- /dev/null +++ b/listati/TCP_echo_sixth.c @@ -0,0 +1,12 @@ + ... + /* check if resetting on close is required */ + if (reset) { + printf("Setting reset on close \n"); + ling.l_onoff = 1; + ling.l_linger = 0; + if (setsockopt(sock, SOL_SOCKET, SO_LINGER, &ling, sizeof(ling))) { + perror("Cannot set linger"); + exit(1); + } + } + ...