THRIFT-2753 Haxe support: Misc. improvements
Client: Haxe
Patch: Jens Geyer
This closes #229
diff --git a/test/haxe/src/TestServer.hx b/test/haxe/src/TestServer.hx
index 66b06e0..92fab01 100644
--- a/test/haxe/src/TestServer.hx
+++ b/test/haxe/src/TestServer.hx
@@ -53,7 +53,8 @@
if ( args.framed) {
trace("- framed transport");
transfactory = new TFramedTransportFactory();
- } else if ( args.buffered) {
+ }
+ if ( args.buffered) {
trace("- buffered transport");
throw "TBufferedTransport not implemented yet";
//transfactory = new TBufferedTransportFactory();
@@ -79,14 +80,23 @@
var processor = new ThriftTestProcessor(handler);
// Simple Server
- var server = new TSimpleServer( processor, transport, transfactory, protfactory);
+ var server : TServer = null;
+ switch( args.servertype)
+ {
+ case simple:
+ server = new TSimpleServer( processor, transport, transfactory, protfactory);
+ default:
+ throw "Unhandled server type";
+ }
/*
// Server event handler
- var events = new TestServerEventHandler();
- server.setEventHandler(serverEvents);
- handler.server = serverEngine;
+ if( args.serverEvents) {
+ var events = new TestServerEventHandler();
+ server.setEventHandler(serverEvents);
+ handler.server = serverEngine;
+ }
*/
// Run it