From a2329bdf8c23046ebfc35aab4f6d329025f4517d Mon Sep 17 00:00:00 2001 From: Joe George Date: Mon, 3 Jun 2024 09:32:50 -0400 Subject: [PATCH] Remove ice_timeout (#214) --- cpp/Ice/callback/Client.cpp | 2 +- cpp/IceBox/hello/Client.cpp | 4 ++-- csharp/Ice/callback/Client.cs | 24 +++++++++---------- csharp/IceBox/hello/Client.cs | 40 +++++++++++++++---------------- java/Ice/callback/Client.java | 2 +- java/IceBox/hello/Client.java | 2 +- php/IceDiscovery/hello/Client.php | 4 ---- python/Ice/callback/client.py | 2 +- 8 files changed, 38 insertions(+), 42 deletions(-) diff --git a/cpp/Ice/callback/Client.cpp b/cpp/Ice/callback/Client.cpp index e05d7aec99..ffcbb65a65 100644 --- a/cpp/Ice/callback/Client.cpp +++ b/cpp/Ice/callback/Client.cpp @@ -58,7 +58,7 @@ int run(const shared_ptr& communicator) { auto sender = Ice::checkedCast( - communicator->propertyToProxy("CallbackSender.Proxy")->ice_twoway()->ice_timeout(-1)->ice_secure(false)); + communicator->propertyToProxy("CallbackSender.Proxy")->ice_twoway()->ice_secure(false)); if (!sender) { cerr << "invalid proxy" << endl; diff --git a/cpp/IceBox/hello/Client.cpp b/cpp/IceBox/hello/Client.cpp index 389bcd5c33..33a316460d 100644 --- a/cpp/IceBox/hello/Client.cpp +++ b/cpp/IceBox/hello/Client.cpp @@ -55,8 +55,8 @@ void menu(); int run(const shared_ptr& communicator) { - auto twoway = Ice::checkedCast( - communicator->propertyToProxy("Hello.Proxy")->ice_twoway()->ice_timeout(-1)->ice_secure(false)); + auto twoway = + Ice::checkedCast(communicator->propertyToProxy("Hello.Proxy")->ice_twoway()->ice_secure(false)); if (!twoway) { cerr << "invalid proxy" << endl; diff --git a/csharp/Ice/callback/Client.cs b/csharp/Ice/callback/Client.cs index 4dcbfe1009..1c2481399e 100644 --- a/csharp/Ice/callback/Client.cs +++ b/csharp/Ice/callback/Client.cs @@ -17,12 +17,12 @@ public static int Main(string[] args) // The new communicator is automatically destroyed (disposed) at the end of the // using statement // - using(var communicator = Ice.Util.initialize(ref args, "config.client")) + using (var communicator = Ice.Util.initialize(ref args, "config.client")) { // // The communicator initialization removes all Ice-related arguments from args // - if(args.Length > 0) + if (args.Length > 0) { Console.Error.WriteLine("too many arguments"); status = 1; @@ -33,7 +33,7 @@ public static int Main(string[] args) } } } - catch(Exception ex) + catch (Exception ex) { Console.Error.WriteLine(ex); status = 1; @@ -45,8 +45,8 @@ public static int Main(string[] args) private static int run(Ice.Communicator communicator) { var sender = CallbackSenderPrxHelper.checkedCast(communicator.propertyToProxy("CallbackSender.Proxy"). - ice_twoway().ice_timeout(-1).ice_secure(false)); - if(sender == null) + ice_twoway().ice_secure(false)); + if (sender == null) { Console.Error.WriteLine("invalid proxy"); return 1; @@ -69,23 +69,23 @@ private static int run(Ice.Communicator communicator) Console.Out.Write("==> "); Console.Out.Flush(); line = Console.In.ReadLine(); - if(line == null) + if (line == null) { break; } - if(line.Equals("t")) + if (line.Equals("t")) { sender.initiateCallback(receiver); } - else if(line.Equals("s")) + else if (line.Equals("s")) { sender.shutdown(); } - else if(line.Equals("x")) + else if (line.Equals("x")) { // Nothing to do } - else if(line.Equals("?")) + else if (line.Equals("?")) { menu(); } @@ -95,12 +95,12 @@ private static int run(Ice.Communicator communicator) menu(); } } - catch(Exception ex) + catch (Exception ex) { Console.Error.WriteLine(ex); } } - while(!line.Equals("x")); + while (!line.Equals("x")); return 0; } diff --git a/csharp/IceBox/hello/Client.cs b/csharp/IceBox/hello/Client.cs index e8a14ada2e..075da04327 100644 --- a/csharp/IceBox/hello/Client.cs +++ b/csharp/IceBox/hello/Client.cs @@ -17,12 +17,12 @@ public static int Main(string[] args) // The new communicator is automatically destroyed (disposed) at the end of the // using statement // - using(var communicator = Ice.Util.initialize(ref args, "config.client")) + using (var communicator = Ice.Util.initialize(ref args, "config.client")) { // // The communicator initialization removes all Ice-related arguments from args // - if(args.Length > 0) + if (args.Length > 0) { Console.Error.WriteLine("too many arguments"); status = 1; @@ -33,7 +33,7 @@ public static int Main(string[] args) } } } - catch(Exception ex) + catch (Exception ex) { Console.Error.WriteLine(ex); status = 1; @@ -45,8 +45,8 @@ public static int Main(string[] args) private static int run(Ice.Communicator communicator) { var twoway = HelloPrxHelper.checkedCast( - communicator.propertyToProxy("Hello.Proxy").ice_twoway().ice_timeout(-1).ice_secure(false)); - if(twoway == null) + communicator.propertyToProxy("Hello.Proxy").ice_twoway().ice_secure(false)); + if (twoway == null) { Console.Error.WriteLine("invalid proxy"); return 1; @@ -68,25 +68,25 @@ private static int run(Ice.Communicator communicator) Console.Out.Write("==> "); Console.Out.Flush(); line = Console.In.ReadLine(); - if(line == null) + if (line == null) { break; } - if(line.Equals("t")) + if (line.Equals("t")) { twoway.sayHello(); } - else if(line.Equals("o")) + else if (line.Equals("o")) { oneway.sayHello(); } - else if(line.Equals("O")) + else if (line.Equals("O")) { batchOneway.sayHello(); } - else if(line.Equals("d")) + else if (line.Equals("d")) { - if(secure) + if (secure) { Console.WriteLine("secure datagrams are not supported"); } @@ -95,9 +95,9 @@ private static int run(Ice.Communicator communicator) datagram.sayHello(); } } - else if(line.Equals("D")) + else if (line.Equals("D")) { - if(secure) + if (secure) { Console.WriteLine("secure datagrams are not supported"); } @@ -106,15 +106,15 @@ private static int run(Ice.Communicator communicator) batchDatagram.sayHello(); } } - else if(line.Equals("f")) + else if (line.Equals("f")) { batchOneway.ice_flushBatchRequests(); - if(!secure) + if (!secure) { batchDatagram.ice_flushBatchRequests(); } } - else if(line.Equals("S")) + else if (line.Equals("S")) { secure = !secure; @@ -124,7 +124,7 @@ private static int run(Ice.Communicator communicator) datagram = HelloPrxHelper.uncheckedCast(datagram.ice_secure(secure)); batchDatagram = HelloPrxHelper.uncheckedCast(batchDatagram.ice_secure(secure)); - if(secure) + if (secure) { Console.WriteLine("secure mode is now on"); } @@ -133,11 +133,11 @@ private static int run(Ice.Communicator communicator) Console.WriteLine("secure mode is now off"); } } - else if(line.Equals("x")) + else if (line.Equals("x")) { // Nothing to do } - else if(line.Equals("?")) + else if (line.Equals("?")) { menu(); } @@ -147,7 +147,7 @@ private static int run(Ice.Communicator communicator) menu(); } } - catch(Exception ex) + catch (Exception ex) { Console.Error.WriteLine(ex); } diff --git a/java/Ice/callback/Client.java b/java/Ice/callback/Client.java index 2ed4de6a45..60c9f9a60d 100644 --- a/java/Ice/callback/Client.java +++ b/java/Ice/callback/Client.java @@ -36,7 +36,7 @@ public static void main(String[] args) private static int run(com.zeroc.Ice.Communicator communicator) { CallbackSenderPrx sender = CallbackSenderPrx.checkedCast( - communicator.propertyToProxy("CallbackSender.Proxy")).ice_twoway().ice_timeout(-1).ice_secure(false); + communicator.propertyToProxy("CallbackSender.Proxy")).ice_twoway().ice_secure(false); if(sender == null) { System.err.println("invalid proxy"); diff --git a/java/IceBox/hello/Client.java b/java/IceBox/hello/Client.java index a784280627..22dc2a87e8 100644 --- a/java/IceBox/hello/Client.java +++ b/java/IceBox/hello/Client.java @@ -36,7 +36,7 @@ private static int run(com.zeroc.Ice.Communicator communicator) { HelloPrx twoway = HelloPrx.checkedCast( - communicator.propertyToProxy("Hello.Proxy")).ice_twoway().ice_timeout(-1).ice_secure(false); + communicator.propertyToProxy("Hello.Proxy")).ice_twoway().ice_secure(false); if(twoway == null) { System.err.println("invalid object reference"); diff --git a/php/IceDiscovery/hello/Client.php b/php/IceDiscovery/hello/Client.php index 19e65d7b33..e86c5de2b7 100644 --- a/php/IceDiscovery/hello/Client.php +++ b/php/IceDiscovery/hello/Client.php @@ -59,10 +59,6 @@ { $p = $p->ice_secure(true); } - if(isset($_POST["timeout"]) and $_POST["timeout"] == "yes") - { - $p = $p->ice_timeout(2000); - } if(isset($_POST["delay"]) and $_POST["delay"] == "yes") { $delay = 2500; diff --git a/python/Ice/callback/client.py b/python/Ice/callback/client.py index 40344dc594..28969df245 100755 --- a/python/Ice/callback/client.py +++ b/python/Ice/callback/client.py @@ -18,7 +18,7 @@ def callback(self, current): def run(communicator): sender = Demo.CallbackSenderPrx.checkedCast( communicator.propertyToProxy('CallbackSender.Proxy'). - ice_twoway().ice_timeout(-1).ice_secure(False)) + ice_twoway().ice_secure(False)) if not sender: print("invalid proxy") sys.exit(1)