iproctor | 7897c92 | 2007-08-08 01:43:39 +0000 | [diff] [blame] | 1 | open Thrift |
| 2 | |
| 3 | class t |
| 4 | (pf : Processor.t) |
| 5 | (st : Transport.server_t) |
| 6 | (tf : Transport.factory) |
| 7 | (ipf : Protocol.factory) |
| 8 | (opf : Protocol.factory)= |
| 9 | object |
| 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 |
| 25 | end |
| 26 | |