THRIFT-5370 Haxe 4 compatibility incl TConfiguration & MAX_MESSAGE_SIZE
Client: haxe
Patch: Jens Geyer
This closes #2349
diff --git a/test/haxe/src/Arguments.hx b/test/haxe/src/Arguments.hx
index 56e5253..023f250 100644
--- a/test/haxe/src/Arguments.hx
+++ b/test/haxe/src/Arguments.hx
@@ -92,7 +92,7 @@
#if sys
private static function GetHelp() : String {
- var sProg = Path.withoutDirectory( Sys.executablePath());
+ var sProg = Path.withoutDirectory( Sys.programPath());
return "\n"
+sProg+" [client|server] [options]\n"
+"\n"
diff --git a/test/haxe/src/TestClient.hx b/test/haxe/src/TestClient.hx
index 853319e..579dc00 100644
--- a/test/haxe/src/TestClient.hx
+++ b/test/haxe/src/TestClient.hx
@@ -35,7 +35,7 @@
import org.apache.thrift.meta_data.*;
#if cpp
-import cpp.vm.Thread;
+import sys.thread.Thread;
#else
// no thread support (yet)
#end
diff --git a/test/haxe/src/TestServer.hx b/test/haxe/src/TestServer.hx
index 450c8f2..d44c68c 100644
--- a/test/haxe/src/TestServer.hx
+++ b/test/haxe/src/TestServer.hx
@@ -39,20 +39,24 @@
switch( args.transport) {
case socket:
trace("- socket port "+args.port);
+ #if (flash || html5 || js)
+ throw "Transport not supported on this platform";
+ #else
transport = new TServerSocket( args.port);
+ #end
case http:
trace("- http");
- #if !phpwebserver
- throw "HTTP server not implemented yet";
- //transport = new THttpServer( targetHost);
+ #if phpwebserver
+ transport = new TWrappingServerTransport(
+ new TStreamTransport(
+ new TFileStream("php://input", Read),
+ new TFileStream("php://output", Append),
+ null
+ )
+ );
#else
- transport = new TWrappingServerTransport(
- new TStreamTransport(
- new TFileStream("php://input", Read),
- new TFileStream("php://output", Append)
- )
- );
-
+ throw "Transport not supported on this platform";
+ //transport = new THttpServer( targetHost);
#end
default:
throw "Unhandled transport";
@@ -86,7 +90,7 @@
// Processor
- var handler = new TestServerHandler();
+ var handler : ThriftTest_service = new TestServerHandler();
var processor = new ThriftTestProcessor(handler);
// Simple Server
diff --git a/test/haxe/src/TestServerHandler.hx b/test/haxe/src/TestServerHandler.hx
index b8a2590..0e19105 100644
--- a/test/haxe/src/TestServerHandler.hx
+++ b/test/haxe/src/TestServerHandler.hx
@@ -36,7 +36,7 @@
import thrift.test.*; // generated code
-class TestServerHandler implements ThriftTest {
+class TestServerHandler implements ThriftTest_service {
public var server:TServer;
@@ -465,8 +465,10 @@
*/
public function testOneway(secondsToSleep:haxe.Int32):Void
{
+ #if sys
trace("testOneway(" + secondsToSleep + "), sleeping...");
Sys.sleep(secondsToSleep);
+ #end
trace("testOneway finished");
}