Thrift: OCaml and HS servers more general

Summary: The library now provides servers that are general like the other languages.
Reviewed by: mcslee
Test plan: Yes
Revert plan: yes


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665195 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/test/ocaml/server/Makefile b/test/ocaml/server/Makefile
index 839292d..88a618a 100644
--- a/test/ocaml/server/Makefile
+++ b/test/ocaml/server/Makefile
@@ -1,7 +1,8 @@
 SOURCES = ../gen-ocaml/ThriftTest_types.ml ../gen-ocaml/ThriftTest_consts.ml ../gen-ocaml/SecondService.ml ../gen-ocaml/ThriftTest.ml TestServer.ml
 RESULT = ts
-INCDIRS = "/home/iproctor/code/projects/thrift/trunk/lib/ocaml/src/" "../gen-ocaml/"
-LIBS = unix thrift
+INCDIRS = "../../../lib/ocaml/src/" "../gen-ocaml/"
+LIBS = thrift
+THREADS = yes
 all: nc
 OCAMLMAKEFILE = ../../../lib/ocaml/OCamlMakefile
 include $(OCAMLMAKEFILE)
diff --git a/test/ocaml/server/TestServer.ml b/test/ocaml/server/TestServer.ml
index 3789035..afcd789 100644
--- a/test/ocaml/server/TestServer.ml
+++ b/test/ocaml/server/TestServer.ml
@@ -102,6 +102,14 @@
 let h = new test_handler in
 let proc = new ThriftTest.processor h in
 let port = 9090 in
-  TServer.run_basic_server proc port;;
+let pf = new TBinaryProtocol.factory in
+let server = new TThreadedServer.t 
+  proc 
+  (new TServerSocket.t port) 
+  (new Transport.factory) 
+  pf 
+  pf 
+in
+  server#serve