summaryrefslogtreecommitdiff
path: root/ghc/misc/examples/net006/Main.hs
diff options
context:
space:
mode:
Diffstat (limited to 'ghc/misc/examples/net006/Main.hs')
-rw-r--r--ghc/misc/examples/net006/Main.hs27
1 files changed, 27 insertions, 0 deletions
diff --git a/ghc/misc/examples/net006/Main.hs b/ghc/misc/examples/net006/Main.hs
new file mode 100644
index 0000000000..57be04e330
--- /dev/null
+++ b/ghc/misc/examples/net006/Main.hs
@@ -0,0 +1,27 @@
+{- client
+
+Client side of net005
+
+TESTS:
+ socket
+ connect
+ writeSocket
+ shutdown
+ sClose
+-}
+
+
+module Main where
+
+import SocketPrim
+
+message = "Hello World"
+
+
+main =
+ socket AF_UNIX Datagram 0 >>= \ s ->
+ connect s (SockAddrUnix "sock") >>
+
+ writeSocket s message >>
+ shutdown s 2 >>
+ sClose s