blob: fa9c8e7bb61f77ccef984e77df2efda21891606e [file] [log] [blame]
iproctorff8eb922007-07-25 19:06:13 +00001module Client where
2import Thrift
3import ThriftTest_Client
4import ThriftTest_Types
5import TSocket
6import TBinaryProtocol
7import qualified Data.Map as Map
8import qualified Data.Set as Set
9import Control.Monad
10t = TSocket "127.0.0.1" 9090 Nothing
11
12main = do to <- topen t
13 let p = TBinaryProtocol to
14 let ps = (p,p)
15 print =<< testString ps "bya"
16 print =<< testByte ps 8
17 print =<< testByte ps (-8)
18 print =<< testI32 ps 32
19 print =<< testI32 ps (-32)
20 print =<< testI64 ps 64
21 print =<< testI64 ps (-64)
22 print =<< testDouble ps 3.14
23 print =<< testDouble ps (-3.14)
24 print =<< testMap ps (Map.fromList [(1,1),(2,2),(3,3)])
25 print =<< testList ps [1,2,3,4,5]
26 print =<< testSet ps (Set.fromList [1,2,3,4,5])
27 print =<< testStruct ps (Xtruct (Just "hi") (Just 4) (Just 5) Nothing)
28 tclose to
David Reiss0c90f6f2008-02-06 22:18:40 +000029