diff options
author | Matthew Newhook <matthew@zeroc.com> | 2005-09-13 02:25:11 +0000 |
---|---|---|
committer | Matthew Newhook <matthew@zeroc.com> | 2005-09-13 02:25:11 +0000 |
commit | 13c1478b4bf220e3c08055f7af39281e2f5d8875 (patch) | |
tree | 2d80b77591f870688270b6637678eddb3e1c6196 /cs/demo/Ice/callback/CallbackClient.cs | |
parent | updates. (diff) | |
download | ice-13c1478b4bf220e3c08055f7af39281e2f5d8875.tar.bz2 ice-13c1478b4bf220e3c08055f7af39281e2f5d8875.tar.xz ice-13c1478b4bf220e3c08055f7af39281e2f5d8875.zip |
http://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=335
Diffstat (limited to 'cs/demo/Ice/callback/CallbackClient.cs')
-rwxr-xr-x | cs/demo/Ice/callback/CallbackClient.cs | 128 |
1 files changed, 0 insertions, 128 deletions
diff --git a/cs/demo/Ice/callback/CallbackClient.cs b/cs/demo/Ice/callback/CallbackClient.cs deleted file mode 100755 index 9a17857f372..00000000000 --- a/cs/demo/Ice/callback/CallbackClient.cs +++ /dev/null @@ -1,128 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2005 ZeroC, Inc. All rights reserved. -// -// This copy of Ice is licensed to you under the terms described in the -// ICE_LICENSE file included in this distribution. -// -// ********************************************************************** - -using System; -using Demo; - -class CallbackClient : Ice.Application -{ - private static void menu() - { - Console.Out.WriteLine("usage:\n" - + "t: send callback as twoway\n" - + "o: send callback as oneway\n" - + "O: send callback as batch oneway\n" - + "d: send callback as datagram\n" - + "D: send callback as batch datagram\n" - + "f: flush all batch requests\n" - + "s: shutdown server\n" - + "x: exit\n" - + "?: help\n"); - } - - public override int run(string[] args) - { - Ice.Properties properties = communicator().getProperties(); - string proxyProperty = "Callback.Client.CallbackServer"; - string proxy = properties.getProperty(proxyProperty); - if(proxy.Length == 0) - { - Console.Error.WriteLine("property `" + proxyProperty + "' not set"); - return 1; - } - - Ice.ObjectPrx @base = communicator().stringToProxy(proxy); - CallbackSenderPrx twoway = - CallbackSenderPrxHelper.checkedCast(@base.ice_twoway().ice_timeout(-1).ice_secure(false)); - if(twoway == null) - { - Console.Error.WriteLine("invalid proxy"); - return 1; - } - CallbackSenderPrx oneway = CallbackSenderPrxHelper.uncheckedCast(twoway.ice_oneway()); - CallbackSenderPrx batchOneway = CallbackSenderPrxHelper.uncheckedCast(twoway.ice_batchOneway()); - CallbackSenderPrx datagram = CallbackSenderPrxHelper.uncheckedCast(twoway.ice_datagram()); - CallbackSenderPrx batchDatagram = CallbackSenderPrxHelper.uncheckedCast(twoway.ice_batchDatagram()); - - Ice.ObjectAdapter adapter = communicator().createObjectAdapter("Callback.Client"); - adapter.add(new CallbackReceiverI(), Ice.Util.stringToIdentity("callbackReceiver")); - adapter.activate(); - - CallbackReceiverPrx twowayR = CallbackReceiverPrxHelper.uncheckedCast( - adapter.createProxy(Ice.Util.stringToIdentity("callbackReceiver"))); - CallbackReceiverPrx onewayR = CallbackReceiverPrxHelper.uncheckedCast( - twowayR.ice_oneway()); - CallbackReceiverPrx datagramR = CallbackReceiverPrxHelper.uncheckedCast(twowayR.ice_datagram()); - - menu(); - - string line = null; - do - { - try - { - Console.Out.Write("==> "); - Console.Out.Flush(); - line = Console.In.ReadLine(); - if(line == null) - { - break; - } - if(line.Equals("t")) - { - twoway.initiateCallback(twowayR); - } - else if(line.Equals("o")) - { - oneway.initiateCallback(onewayR); - } - else if(line.Equals("O")) - { - batchOneway.initiateCallback(onewayR); - } - else if(line.Equals("d")) - { - datagram.initiateCallback(datagramR); - } - else if(line.Equals("D")) - { - batchDatagram.initiateCallback(datagramR); - } - else if(line.Equals("f")) - { - communicator().flushBatchRequests(); - } - else if(line.Equals("s")) - { - twoway.shutdown(); - } - else if(line.Equals("x")) - { - // Nothing to do - } - else if(line.Equals("?")) - { - menu(); - } - else - { - Console.Out.WriteLine("unknown command `" + line + "'"); - menu(); - } - } - catch(System.Exception ex) - { - Console.Error.WriteLine(ex); - } - } - while(!line.Equals("x")); - - return 0; - } -} |