blob: db3ac3bcb91a05b9bec071e0b7f66921d5344ab4 [file] [log] [blame]
iproctor9a41a0c2007-07-16 21:59:24 +00001open Thrift
2module S = TServer
3
iproctor7897c922007-08-08 01:43:39 +00004class t pf st tf ipf opf =
iproctor9a41a0c2007-07-16 21:59:24 +00005object
iproctor7897c922007-08-08 01:43:39 +00006 inherit S.t pf st tf ipf opf
iproctor9a41a0c2007-07-16 21:59:24 +00007 method serve =
8 try
9 st#listen;
10 let c = st#accept in
iproctor7897c922007-08-08 01:43:39 +000011 let trans = tf#getTransport c in
12 let inp = ipf#getProtocol trans in
13 let op = opf#getProtocol trans in
iproctor9a41a0c2007-07-16 21:59:24 +000014 try
iproctor7897c922007-08-08 01:43:39 +000015 while (pf#process inp op) do () done;
16 trans#close
17 with e -> trans#close; raise e
iproctor9a41a0c2007-07-16 21:59:24 +000018 with _ -> ()
19end