diff options
author | Jens Geyer <jensg@apache.org> | 2021-02-25 09:42:52 +0100 |
---|---|---|
committer | Jens Geyer <jensg@apache.org> | 2021-03-17 20:42:29 +0100 |
commit | 2dcefadba853c9ad0ab5e908894213826ec3b43a (patch) | |
tree | 2b5f791d79d67538dbb7001673b43203fecea339 /tutorial/haxe | |
parent | 62beb6751d3c70f8db8fed4a3bb76e4ff3765c22 (diff) | |
download | thrift-2dcefadba853c9ad0ab5e908894213826ec3b43a.tar.gz |
THRIFT-5370 Haxe 4 compatibility incl TConfiguration & MAX_MESSAGE_SIZE
Client: haxe
Patch: Jens Geyer
This closes #2349
Diffstat (limited to 'tutorial/haxe')
-rw-r--r-- | tutorial/haxe/Tutorial.hxproj | 4 | ||||
-rw-r--r-- | tutorial/haxe/php-web-server.hxml | 2 | ||||
-rw-r--r-- | tutorial/haxe/php.hxml | 2 | ||||
-rw-r--r-- | tutorial/haxe/src/CalculatorHandler.hx | 2 | ||||
-rw-r--r-- | tutorial/haxe/src/Main.hx | 35 |
5 files changed, 28 insertions, 17 deletions
diff --git a/tutorial/haxe/Tutorial.hxproj b/tutorial/haxe/Tutorial.hxproj index 796f648a5..44e0efdbb 100644 --- a/tutorial/haxe/Tutorial.hxproj +++ b/tutorial/haxe/Tutorial.hxproj @@ -4,7 +4,7 @@ <output> <movie outputType="Application" /> <movie input="" /> - <movie path="bin/HaxeTutorial" /> + <movie path="bin\HaxeTutorial" /> <movie fps="30" /> <movie width="800" /> <movie height="600" /> @@ -17,7 +17,7 @@ <classpaths> <class path="src" /> <class path="gen-haxe" /> - <class path="../../lib/haxe/src" /> + <class path="..\..\lib\haxe\src" /> </classpaths> <!-- Build options --> <build> diff --git a/tutorial/haxe/php-web-server.hxml b/tutorial/haxe/php-web-server.hxml index 395a8521e..88007c18f 100644 --- a/tutorial/haxe/php-web-server.hxml +++ b/tutorial/haxe/php-web-server.hxml @@ -27,7 +27,7 @@ #PHP target -php bin/php-web-server/ ---php-front Main-debug.php +-D php-front=Main-debug.php #defines -D phpwebserver diff --git a/tutorial/haxe/php.hxml b/tutorial/haxe/php.hxml index c2f68878e..42bbf7424 100644 --- a/tutorial/haxe/php.hxml +++ b/tutorial/haxe/php.hxml @@ -27,7 +27,7 @@ #PHP target -php bin/php/ ---php-front Main-debug.php +-D php-front=Main-debug.php #Add debug information -debug diff --git a/tutorial/haxe/src/CalculatorHandler.hx b/tutorial/haxe/src/CalculatorHandler.hx index e9752db9f..fcb06d196 100644 --- a/tutorial/haxe/src/CalculatorHandler.hx +++ b/tutorial/haxe/src/CalculatorHandler.hx @@ -31,7 +31,7 @@ import tutorial.*; import shared.*; -class CalculatorHandler implements Calculator { +class CalculatorHandler implements Calculator_service { private var log = new IntMap<SharedStruct>(); diff --git a/tutorial/haxe/src/Main.hx b/tutorial/haxe/src/Main.hx index 6bebe7164..a56549f8c 100644 --- a/tutorial/haxe/src/Main.hx +++ b/tutorial/haxe/src/Main.hx @@ -32,6 +32,7 @@ import shared.*; enum Prot { binary; json; + compact; } enum Trns { @@ -112,12 +113,12 @@ class Main { #if ! (flash || js) private static function GetHelp() : String { - return Sys.executablePath()+" modus trnsOption transport protocol\n" + return Sys.programPath+" modus layered transport protocol\n" +"Options:\n" - +" modus: client, server (default: client)\n" - +" trnsOption: framed, buffered (default: none)\n" - +" transport: socket, http (default: socket)\n" - +" protocol: binary, json (default: binary)\n" + +" modus: client, server (default: client)\n" + +" layered: framed, buffered (default: none)\n" + +" transport: socket, http (default: socket)\n" + +" protocol: binary, json, compact (default: binary)\n" +"\n" +"All arguments are optional.\n"; } @@ -160,6 +161,9 @@ class Main { } else if ( arg == "json") { prot = json; ++step; + } else if ( arg == "compact") { + prot = compact; + ++step; } else { throw "Unknown protocol "+arg; } @@ -217,6 +221,9 @@ class Main { case json: trace("- JSON protocol"); protocol = new TJSONProtocol( transport); + case compact: + trace("- compact protocol"); + protocol = new TCompactProtocol( transport); default: throw "Unhandled protocol"; } @@ -232,7 +239,7 @@ class Main { var client = ClientSetup(); try { - client.ping(); + client.ping(); trace("ping() successful"); } catch(error : TException) { trace('ping() failed: $error'); @@ -310,11 +317,12 @@ class Main { #else trace("- http transport"); transport = new TWrappingServerTransport( - new TStreamTransport( - new TFileStream("php://input", Read), - new TFileStream("php://output", Append) - ) - ); + new TStreamTransport( + new TFileStream("php://input", Read), + new TFileStream("php://output", Append), + null + ) + ); #end default: @@ -341,11 +349,14 @@ class Main { case json: trace("- JSON protocol"); protfactory = new TJSONProtocolFactory(); + case compact: + trace("- compact protocol"); + protfactory = new TCompactProtocolFactory(); default: throw "Unhandled protocol"; } - var handler = new CalculatorHandler(); + var handler : Calculator_service = new CalculatorHandler(); var processor = new CalculatorProcessor(handler); var server = new TSimpleServer( processor, transport, transfactory, protfactory); #if phpwebserver |