about summary refs log tree commit diff
path: root/socket/client.c
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-12-05T13·57+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-12-05T13·57+0000
commitfc1c20d11b5e95690ad5acf6bebd5cea129618e3 (patch)
treedae0e426a80d810870d6d30d05419d851af59ffc /socket/client.c
parenta9c4f66cfb1618833cc70ceaf13733730b634193 (diff)
* Redundant.
Diffstat (limited to 'socket/client.c')
-rw-r--r--socket/client.c43
1 files changed, 0 insertions, 43 deletions
diff --git a/socket/client.c b/socket/client.c
deleted file mode 100644
index a132a7a9ee95..000000000000
--- a/socket/client.c
+++ /dev/null
@@ -1,43 +0,0 @@
-#include <assert.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-
-
-#define SOCKET_PATH "/tmp/nix-daemon"
-
-
-int main(int argc, char * * argv)
-{
-    int res;
-    
-    int sock = socket(PF_UNIX, SOCK_STREAM, 0);
-    assert(sock != -1);
-
-    struct sockaddr_un addr;
-    addr.sun_family = AF_UNIX;
-    strcpy(addr.sun_path, SOCKET_PATH);
-    
-    res = connect(sock, (struct sockaddr *) &addr, sizeof(addr));
-    assert(res != -1);
-
-    int i;
-    for (i = 0; i < 100000; i++) {
-        int len = send(sock, &i, sizeof(i), 0);
-        assert(len == sizeof(i));
-
-        int j;
-        len = recv(sock, &j, sizeof(j), 0);
-        if (len < sizeof(j)) break;
-        assert(i * 2 == j);
-    }
-
-    close(sock);
-
-    return 0;
-}