Risistemate le trattazioni delle opzioni SO_KEEPALIVE e SO_REUSEADDR, con
[gapil.git] / listati / TCP_echod_fifth.c
diff --git a/listati/TCP_echod_fifth.c b/listati/TCP_echod_fifth.c
new file mode 100644 (file)
index 0000000..0977366
--- /dev/null
@@ -0,0 +1,18 @@
+int main(int argc, char *argv[])
+{
+/* 
+ * Variables definition  
+ */
+    int list_fd, conn_fd;
+    int keepalive = 0; 
+    int reuse = 0;
+    ... 
+    /* create and bind socket */
+    if ( (list_fd = sockbindopt(argv[optind], "echo", 6, 
+                               SOCK_STREAM, reuse)) < 0) {
+       return 1;
+    }   
+    ...
+    /* normal exit, never reached */
+    exit(0);
+}