[project @ 2001-08-22 12:24:41 by simonmar]
[ghc-hetmet.git] / ghc / tests / lib / socket / socket001.hs
diff --git a/ghc/tests/lib/socket/socket001.hs b/ghc/tests/lib/socket/socket001.hs
deleted file mode 100644 (file)
index 313f11d..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-{- server
-
-The purpose of this test driver is to test TCP Stream sockets.
-All values have been hard coded since the BSD library is not used to
-query the databases for the values.  In therory this code is thus not
-portable but net007/Main.hs provides a portable version using the BSD
-module.
-
-This creates a stream socket bound to port 5000 and waits for incoming
-messages it then reads all available data before closing the
-connection to that peer.
-
-No form of error checking is provided other than that already provided
-by module SocketPrim.
-
-
-TESTS:
-    socket
-    bindSocket
-    listen
-    accept
-    readSocket
-    sClose
-
--}
-
-
-module Main where
-
-import SocketPrim
-
-main = do
-    s <- socket AF_INET Stream 6
-    bindSocket s (SockAddrInet (mkPortNumber 5000) iNADDR_ANY)
-    listen s 5
-
-    let 
-      loop = 
-       accept s                                >>= \ (s',peerAddr) ->
-       putStr "*** Start of Transfer ***\n"    >>
-       let 
-         read_all = 
-           readSocket s' 4                     >>= \ (str, nbytes) ->
-           if nbytes /= 0 then
-               putStr str                      >>
-               read_all
-           else
-               putStr "\n*** End of Transfer ***\n" >>
-               sClose s'
-       in
-           read_all    
-
-    loop
-