X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fmisc%2Fexamples%2Fnet006%2FMain.hs;fp=ghc%2Fmisc%2Fexamples%2Fnet006%2FMain.hs;h=57be04e330a2b2885690e652dda9b4d958ab000f;hb=e7d21ee4f8ac907665a7e170c71d59e13a01da09;hp=0000000000000000000000000000000000000000;hpb=e48474bff05e6cfb506660420f025f694c870d38;p=ghc-hetmet.git diff --git a/ghc/misc/examples/net006/Main.hs b/ghc/misc/examples/net006/Main.hs new file mode 100644 index 0000000..57be04e --- /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