blob: 6e083135f28ebc37a37d3d3554fcce002165f8a1 [file] [log] [blame]
Mark Slee02d1edc2007-03-07 05:17:25 +00001#!/usr/bin/env ruby
Mark Slee157d9f72007-02-07 06:03:53 +00002
3$:.push('gen-rb')
4$:.push('../../lib/rb/lib')
5
6require 'thrift/transport/tsocket'
7require 'thrift/protocol/tbinaryprotocol'
8require 'thrift/server/tserver'
9require 'ThriftTest'
10
11class TestHandler
12 include ThriftTest::Iface
13
14 def testVoid()
15 print "testVoid()\n"
16 end
17
18 def testString(thing)
19 print "testString(#{thing})\n"
20 return thing
21 end
22
23 def testByte(thing)
24 print "testByte(#{thing})\n"
25 return thing
26 end
27
28 def testI32(thing)
29 print "testI32(#{thing})\n"
30 return thing
31 end
32
33 def testI64(thing)
34 print "testI64(#{thing})\n"
35 return thing
36 end
37
38 def testDouble(thing)
39 print "testDouble(#{thing})\n"
40 return thing
41 end
42
43 def testStruct(thing)
44 print "testStruct(#{thing})\n"
45 return thing
46 end
47
48 def testMap(thing)
49 print "testMap(#{thing})\n"
50 return thing
51 end
52
53 def testSet(thing)
54 print "testSet(#{thing})\n"
55 return thing
56 end
57
58 def testList(thing)
59 print "testList(#{thing})\n"
60 return thing
61 end
62
63end
64
65handler = TestHandler.new()
66processor = ThriftTest::Processor.new(handler)
67transport = TServerSocket.new(9090)
68server = TSimpleServer.new(processor, transport)
69server.serve()