blob: 10f1614112ba9b1cb545170e88a018cb28dd954d [file] [log] [blame]
iproctor7897c922007-08-08 01:43:39 +00001open Thrift
2
3class t
4 (pf : Processor.t)
5 (st : Transport.server_t)
6 (tf : Transport.factory)
7 (ipf : Protocol.factory)
8 (opf : Protocol.factory)=
9object
10 inherit TServer.t pf st tf ipf opf
11 method serve =
12 st#listen;
13 while true do
14 let tr = tf#getTransport (st#accept) in
15 ignore (Thread.create
16 (fun _ ->
17 let ip = ipf#getProtocol tr in
18 let op = opf#getProtocol tr in
19 try
20 while pf#process ip op do
21 ()
22 done
23 with _ -> ()) ())
24 done
25end
26