Add stage2/ghci to ghc-api's import list.
[ghc-hetmet.git] / ghc / misc / examples / net002 / Main.hs
1 {- client
2
3 Client side to net001/Main.hs.
4
5 Note that the machine IP numbers have been hard coded into this
6 program so it is unlikely that you will be able to run this test if
7 you are not at dcs.gla.ac.uk :-(
8
9 The reason for this is to aviod using the BSD module at this stage of
10 testing.
11
12
13 TESTS:
14     socket
15     connect
16     writeSocket
17     shutdown
18     inet_addr
19 -}
20
21
22 module Main where
23
24 import SocketPrim
25
26
27 starbuck    = "130.209.240.81"          -- SunOS 4.1.3 1 sun4c
28 marcus      = "130.209.247.2"           -- SunOS 4.1.3 6 sun4m
29 avon        = "130.209.247.4"           -- OSF1 V2.0 240 alpha
30 karkar      = "130.209.247.3"           -- OSF1 V2.0 240 alpha
31
32 message     = "Hello World"
33
34
35 main =
36     socket AF_INET Stream 6                             >>= \ s ->
37     connect s (SockAddrInet 5000 (inet_addr avon))      >>
38     
39     writeSocket s message                               >>
40     shutdown s 2                                        >>
41     sClose s
42