summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghc-regress/lib/socket/socket007.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/ghc-regress/lib/socket/socket007.hs')
-rw-r--r--testsuite/tests/ghc-regress/lib/socket/socket007.hs44
1 files changed, 0 insertions, 44 deletions
diff --git a/testsuite/tests/ghc-regress/lib/socket/socket007.hs b/testsuite/tests/ghc-regress/lib/socket/socket007.hs
deleted file mode 100644
index fbc9ff04e0..0000000000
--- a/testsuite/tests/ghc-regress/lib/socket/socket007.hs
+++ /dev/null
@@ -1,44 +0,0 @@
-{- server
-
-As net003 but uses the BSD module for portability. Also prints the
-common name of the host rather than its IP number.
-
-TESTS:
- getProtocolNumber
- getSocketName
- getHostByAddr
-
--}
-
-module Main where
-
-import BSD
-import SocketPrim
-
-main =
- getProtocolNumber "tcp" >>= \ proto ->
- socket AF_INET Stream proto >>= \ s ->
- bindSocket s (SockAddrInet aNY_PORT iNADDR_ANY) >>
- getSocketName s >>= \ (SockAddrInet port _) ->
- putStr ("Allocated Port Number: " ++ show port ++ "\n") >>
- listen s 5 >>
-
-
- let
- loop =
- accept s >>= \ (s',(SockAddrInet _ haddr)) ->
- getHostByAddr AF_INET haddr >>= \ (HostEntry hname _ _ _) ->
- putStr ("*** Start of Transfer from: " ++ hname ++ "***\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
- in
- loop