[project @ 1996-01-08 20:28:12 by partain]
[ghc-hetmet.git] / ghc / misc / examples / net006 / Main.hs
diff --git a/ghc/misc/examples/net006/Main.hs b/ghc/misc/examples/net006/Main.hs
new file mode 100644 (file)
index 0000000..57be04e
--- /dev/null
@@ -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