projects
/
ghc-hetmet.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
[project @ 2001-05-01 11:46:56 by simonmar]
[ghc-hetmet.git]
/
ghc
/
tests
/
lib
/
net
/
net001.hs
1
module Main where
2
3
import Socket
4
import Concurrent
5
import IO
6
7
main = do
8
forkIO server
9
yield
10
h <- connectTo "localhost" (PortNumber 22222)
11
l <- hGetLine h
12
hClose h
13
print l
14
where
15
server = do
16
s <- listenOn (PortNumber 22222)
17
(h, host, port) <- accept s
18
hPutStrLn h "hello"
19
hClose h
20