Skip to content

Commit

Permalink
Remove ice_timeout (#214)
Browse files Browse the repository at this point in the history
  • Loading branch information
externl authored Jun 3, 2024
1 parent dfc0412 commit a2329bd
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 42 deletions.
2 changes: 1 addition & 1 deletion cpp/Ice/callback/Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ int
run(const shared_ptr<Ice::Communicator>& communicator)
{
auto sender = Ice::checkedCast<CallbackSenderPrx>(
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;
Expand Down
4 changes: 2 additions & 2 deletions cpp/IceBox/hello/Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ void menu();
int
run(const shared_ptr<Ice::Communicator>& communicator)
{
auto twoway = Ice::checkedCast<HelloPrx>(
communicator->propertyToProxy("Hello.Proxy")->ice_twoway()->ice_timeout(-1)->ice_secure(false));
auto twoway =
Ice::checkedCast<HelloPrx>(communicator->propertyToProxy("Hello.Proxy")->ice_twoway()->ice_secure(false));
if (!twoway)
{
cerr << "invalid proxy" << endl;
Expand Down
24 changes: 12 additions & 12 deletions csharp/Ice/callback/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -33,7 +33,7 @@ public static int Main(string[] args)
}
}
}
catch(Exception ex)
catch (Exception ex)
{
Console.Error.WriteLine(ex);
status = 1;
Expand All @@ -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;
Expand All @@ -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();
}
Expand All @@ -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;
}
Expand Down
40 changes: 20 additions & 20 deletions csharp/IceBox/hello/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -33,7 +33,7 @@ public static int Main(string[] args)
}
}
}
catch(Exception ex)
catch (Exception ex)
{
Console.Error.WriteLine(ex);
status = 1;
Expand All @@ -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;
Expand All @@ -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");
}
Expand All @@ -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");
}
Expand All @@ -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;

Expand All @@ -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");
}
Expand All @@ -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();
}
Expand All @@ -147,7 +147,7 @@ private static int run(Ice.Communicator communicator)
menu();
}
}
catch(Exception ex)
catch (Exception ex)
{
Console.Error.WriteLine(ex);
}
Expand Down
2 changes: 1 addition & 1 deletion java/Ice/callback/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion java/IceBox/hello/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
4 changes: 0 additions & 4 deletions php/IceDiscovery/hello/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion python/Ice/callback/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a2329bd

Please sign in to comment.