Start a new directory for networking tests, and add a simple test
which starts two threads which communicate via a socket.
The socket subdirectory already contains some tests, but they're about
6 years old and don't appear to be designed to run without user
intervention.
#-----------------------------------------------------------------------------
-# $Id: Makefile,v 1.4 1998/09/20 15:33:58 simonm Exp $
+# $Id: Makefile,v 1.5 2001/05/01 11:46:56 simonmar Exp $
TOP = ..
include $(TOP)/mk/boilerplate.mk
-SUBDIRS = should_run
+SUBDIRS = should_run net
# posix009 hangs on Linux, disabled for now --SDM
# posix
--- /dev/null
+# -----------------------------------------------------------------------------
+# $Id: Makefile,v 1.1 2001/05/01 11:46:56 simonmar Exp $
+
+TOP = ../..
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/should_run.mk
+
+SRC_HC_OPTS += -dcore-lint -package net -fglasgow-exts
+
+.PRECIOUS: %.o %.bin
+
+include $(TOP)/mk/target.mk
--- /dev/null
+module Main where
+
+import Socket
+import Concurrent
+import IO
+
+main = do
+ forkIO server
+ yield
+ h <- connectTo "localhost" (PortNumber 22222)
+ l <- hGetLine h
+ hClose h
+ print l
+ where
+ server = do
+ s <- listenOn (PortNumber 22222)
+ (h, host, port) <- accept s
+ hPutStrLn h "hello"
+ hClose h
+