diff options
Diffstat (limited to 'cs/demo/Ice/hello/Client.cs')
-rwxr-xr-x | cs/demo/Ice/hello/Client.cs | 130 |
1 files changed, 65 insertions, 65 deletions
diff --git a/cs/demo/Ice/hello/Client.cs b/cs/demo/Ice/hello/Client.cs index 73586a5c695..98eef16d0d1 100755 --- a/cs/demo/Ice/hello/Client.cs +++ b/cs/demo/Ice/hello/Client.cs @@ -15,38 +15,38 @@ public class Client : Ice.Application private static void menu() { Console.Write( - "usage:\n" + - "t: send greeting as twoway\n" + - "o: send greeting as oneway\n" + - "O: send greeting as batch oneway\n" + - "d: send greeting as datagram\n" + - "D: send greeting as batch datagram\n" + - "f: flush all batch requests\n" + - "T: set a timeout\n" + - "P: set a server delay"); - if(_haveSSL) - { + "usage:\n" + + "t: send greeting as twoway\n" + + "o: send greeting as oneway\n" + + "O: send greeting as batch oneway\n" + + "d: send greeting as datagram\n" + + "D: send greeting as batch datagram\n" + + "f: flush all batch requests\n" + + "T: set a timeout\n" + + "P: set a server delay"); + if(_haveSSL) + { Console.Write("\nS: switch secure mode on/off"); - } + } Console.WriteLine( - "\ns: shutdown server\n" + - "x: exit\n" + - "?: help\n"); + "\ns: shutdown server\n" + + "x: exit\n" + + "?: help\n"); } public override int run(string[] args) { - try - { - communicator().getPluginManager().getPlugin("IceSSL"); - _haveSSL = true; - } - catch(Ice.NotRegisteredException) - { - } + try + { + communicator().getPluginManager().getPlugin("IceSSL"); + _haveSSL = true; + } + catch(Ice.NotRegisteredException) + { + } HelloPrx twoway = HelloPrxHelper.checkedCast( - communicator().propertyToProxy("Hello.Proxy").ice_twoway().ice_timeout(-1).ice_secure(false)); + communicator().propertyToProxy("Hello.Proxy").ice_twoway().ice_timeout(-1).ice_secure(false)); if(twoway == null) { Console.Error.WriteLine("invalid proxy"); @@ -57,9 +57,9 @@ public class Client : Ice.Application HelloPrx datagram = HelloPrxHelper.uncheckedCast(twoway.ice_datagram()); HelloPrx batchDatagram = HelloPrxHelper.uncheckedCast(twoway.ice_batchDatagram()); - bool secure = false; + bool secure = false; int timeout = -1; - int delay = 0; + int delay = 0; menu(); @@ -89,25 +89,25 @@ public class Client : Ice.Application } else if(line.Equals("d")) { - if(secure) - { - Console.WriteLine("secure datagrams are not supported"); - } - else - { - datagram.sayHello(delay); - } + if(secure) + { + Console.WriteLine("secure datagrams are not supported"); + } + else + { + datagram.sayHello(delay); + } } else if(line.Equals("D")) { - if(secure) - { - Console.WriteLine("secure datagrams are not supported"); - } - else - { - batchDatagram.sayHello(delay); - } + if(secure) + { + Console.WriteLine("secure datagrams are not supported"); + } + else + { + batchDatagram.sayHello(delay); + } } else if(line.Equals("f")) { @@ -136,7 +136,7 @@ public class Client : Ice.Application { Console.WriteLine("timeout is now set to 2000ms"); } - } + } else if(line.Equals("P")) { if(delay == 0) @@ -157,25 +157,25 @@ public class Client : Ice.Application Console.WriteLine("server delay is now set to 2500ms"); } } - else if(_haveSSL && line.Equals("S")) - { - secure = !secure; + else if(_haveSSL && line.Equals("S")) + { + secure = !secure; - twoway = HelloPrxHelper.uncheckedCast(twoway.ice_secure(secure)); - oneway = HelloPrxHelper.uncheckedCast(oneway.ice_secure(secure)); - batchOneway = HelloPrxHelper.uncheckedCast(batchOneway.ice_secure(secure)); - datagram = HelloPrxHelper.uncheckedCast(datagram.ice_secure(secure)); - batchDatagram = HelloPrxHelper.uncheckedCast(batchDatagram.ice_secure(secure)); + twoway = HelloPrxHelper.uncheckedCast(twoway.ice_secure(secure)); + oneway = HelloPrxHelper.uncheckedCast(oneway.ice_secure(secure)); + batchOneway = HelloPrxHelper.uncheckedCast(batchOneway.ice_secure(secure)); + datagram = HelloPrxHelper.uncheckedCast(datagram.ice_secure(secure)); + batchDatagram = HelloPrxHelper.uncheckedCast(batchDatagram.ice_secure(secure)); - if(secure) - { - Console.WriteLine("secure mode is now on"); - } - else - { - Console.WriteLine("secure mode is now off"); - } - } + if(secure) + { + Console.WriteLine("secure mode is now on"); + } + else + { + Console.WriteLine("secure mode is now off"); + } + } else if(line.Equals("s")) { twoway.shutdown(); @@ -196,7 +196,7 @@ public class Client : Ice.Application } catch(System.Exception ex) { - Console.Error.WriteLine(ex); + Console.Error.WriteLine(ex); } } while (!line.Equals("x")); @@ -208,10 +208,10 @@ public class Client : Ice.Application { Client app = new Client(); int status = app.main(args, "config.client"); - if(status != 0) - { - System.Environment.Exit(status); - } + if(status != 0) + { + System.Environment.Exit(status); + } } private static bool _haveSSL = false; |