iproctor | 9a41a0c | 2007-07-16 21:59:24 +0000 | [diff] [blame] | 1 | open Thrift |
2 | module S = TServer | ||||
3 | |||||
iproctor | 7897c92 | 2007-08-08 01:43:39 +0000 | [diff] [blame] | 4 | class t pf st tf ipf opf = |
iproctor | 9a41a0c | 2007-07-16 21:59:24 +0000 | [diff] [blame] | 5 | object |
iproctor | 7897c92 | 2007-08-08 01:43:39 +0000 | [diff] [blame] | 6 | inherit S.t pf st tf ipf opf |
iproctor | 9a41a0c | 2007-07-16 21:59:24 +0000 | [diff] [blame] | 7 | method serve = |
8 | try | ||||
9 | st#listen; | ||||
10 | let c = st#accept in | ||||
iproctor | 7897c92 | 2007-08-08 01:43:39 +0000 | [diff] [blame] | 11 | let trans = tf#getTransport c in |
12 | let inp = ipf#getProtocol trans in | ||||
13 | let op = opf#getProtocol trans in | ||||
iproctor | 9a41a0c | 2007-07-16 21:59:24 +0000 | [diff] [blame] | 14 | try |
iproctor | 7897c92 | 2007-08-08 01:43:39 +0000 | [diff] [blame] | 15 | while (pf#process inp op) do () done; |
16 | trans#close | ||||
17 | with e -> trans#close; raise e | ||||
iproctor | 9a41a0c | 2007-07-16 21:59:24 +0000 | [diff] [blame] | 18 | with _ -> () |
19 | end |