本文整理汇总了C#中Ice.ice_response方法的典型用法代码示例。如果您正苦于以下问题:C# Ice.ice_response方法的具体用法?C# Ice.ice_response怎么用?C# Ice.ice_response使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ice
的用法示例。
在下文中一共展示了Ice.ice_response方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ice_invoke_async
public override void ice_invoke_async(Ice.AMD_Object_ice_invoke cb, byte[] inParams, Ice.Current current)
{
Ice.Communicator communicator = current.adapter.getCommunicator();
Ice.InputStream inS = Ice.Util.createInputStream(communicator, inParams);
Ice.OutputStream outS = Ice.Util.createOutputStream(communicator);
if(current.operation.Equals("opOneway"))
{
cb.ice_response(true, new byte[0]);
}
else if(current.operation.Equals("opString"))
{
string s = inS.readString();
outS.writeString(s);
outS.writeString(s);
cb.ice_response(true, outS.finished());
}
else if(current.operation.Equals("opException"))
{
Test.MyException ex = new Test.MyException();
outS.writeException(ex);
cb.ice_response(false, outS.finished());
}
else if(current.operation.Equals("shutdown"))
{
communicator.shutdown();
cb.ice_response(true, null);
}
else if(current.operation.Equals("ice_isA"))
{
string s = inS.readString();
if(s.Equals("::Test::MyClass"))
{
outS.writeBool(true);
}
else
{
outS.writeBool(false);
}
cb.ice_response(true, outS.finished());
}
else
{
Ice.OperationNotExistException ex = new Ice.OperationNotExistException();
ex.id = current.id;
ex.facet = current.facet;
ex.operation = current.operation;
throw ex;
}
}
示例2: findAdapterById_async
public override void findAdapterById_async(Ice.AMD_Locator_findAdapterById response, string adapter,
Ice.Current current)
{
++_requestCount;
if(adapter.Equals("TestAdapter10") || adapter.Equals("TestAdapter10-2"))
{
Debug.Assert(current.encoding.Equals(Ice.Util.Encoding_1_0));
response.ice_response(_registry.getAdapter("TestAdapter"));
return;
}
// We add a small delay to make sure locator request queuing gets tested when
// running the test on a fast machine
System.Threading.Thread.Sleep(1);
response.ice_response(_registry.getAdapter(adapter));
}
示例3: findAdapterById_async
public override void findAdapterById_async(Ice.AMD_Locator_findAdapterById response, string adapter,
Ice.Current current)
{
_controller.checkCallPause(current);
Ice.Communicator communicator = current.adapter.getCommunicator();
response.ice_response(current.adapter.createDirectProxy(communicator.stringToIdentity("dummy")));
}
示例4: setServerProcessProxy_async
setServerProcessProxy_async(Ice.AMD_LocatorRegistry_setServerProcessProxy cb,
string id,
Ice.ProcessPrx process,
Ice.Current current)
{
cb.ice_response();
}
示例5: setReplicatedAdapterDirectProxy_async
setReplicatedAdapterDirectProxy_async(Ice.AMD_LocatorRegistry_setReplicatedAdapterDirectProxy cb,
string adapterId,
string replicaGroupId,
Ice.ObjectPrx proxy,
Ice.Current current)
{
lock(this)
{
if(proxy != null)
{
_adapters.Add(adapterId, proxy);
HashSet<string> adapterIds;
if(!_replicaGroups.TryGetValue(replicaGroupId, out adapterIds))
{
adapterIds = new HashSet<string>();
_replicaGroups.Add(replicaGroupId, adapterIds);
}
adapterIds.Add(adapterId);
}
else
{
_adapters.Remove(adapterId);
HashSet<string> adapterIds;
if(_replicaGroups.TryGetValue(replicaGroupId, out adapterIds))
{
adapterIds.Remove(adapterId);
if(adapterIds.Count == 0)
{
_replicaGroups.Remove(replicaGroupId);
}
}
}
}
cb.ice_response();
}
示例6: findObjectById_async
public override void findObjectById_async(Ice.AMD_Locator_findObjectById response, Ice.Identity id,
Ice.Current current)
{
++_requestCount;
// We add a small delay to make sure locator request queuing gets tested when
// running the test on a fast machine
System.Threading.Thread.Sleep(1);
response.ice_response(_registry.getObject(id));
}
示例7: setAdapterDirectProxy_async
public override void setAdapterDirectProxy_async(Ice.AMD_LocatorRegistry_setAdapterDirectProxy cb, string adapter,
Ice.ObjectPrx obj, Ice.Current current)
{
if(obj != null)
{
_adapters[adapter] = obj;
}
else
{
_adapters.Remove(adapter);
}
cb.ice_response();
}
示例8: ice_invoke_async
public override void ice_invoke_async(Ice.AMD_Object_ice_invoke amdCb, byte[] inEncaps, Ice.Current current)
{
bool twoway = current.requestId > 0;
Ice.ObjectPrx obj = current.con.createProxy(current.id);
if(!twoway)
{
if(_startBatch)
{
_startBatch = false;
_batchProxy = obj.ice_batchOneway();
}
if(_batchProxy != null)
{
obj = _batchProxy;
}
if(current.facet.Length != 0)
{
obj = obj.ice_facet(current.facet);
}
if(_batchProxy != null)
{
byte[] outEncaps;
obj.ice_invoke(current.operation, current.mode, inEncaps, out outEncaps, current.ctx);
amdCb.ice_response(true, new byte[0]);
}
else
{
Callback cb = new Callback(amdCb, false);
obj.ice_oneway().begin_ice_invoke(current.operation,
current.mode,
inEncaps,
current.ctx).whenCompleted(cb.response, cb.exception)
.whenSent(cb.sent);
}
}
else
{
if(current.facet.Length != 0)
{
obj = obj.ice_facet(current.facet);
}
Callback cb = new Callback(amdCb, true);
obj.begin_ice_invoke(current.operation,
current.mode,
inEncaps,
current.ctx).whenCompleted(cb.response, cb.exception).whenSent(cb.sent);
}
}
示例9: setAdapterDirectProxy_async
setAdapterDirectProxy_async(Ice.AMD_LocatorRegistry_setAdapterDirectProxy cb,
string adapterId,
Ice.ObjectPrx proxy,
Ice.Current current)
{
lock(this)
{
if(proxy != null)
{
_adapters.Add(adapterId, proxy);
}
else
{
_adapters.Remove(adapterId);
}
cb.ice_response();
}
}
示例10: findObjectById_async
public override void findObjectById_async(Ice.AMD_Locator_findObjectById amdCB, Ice.Identity id, Ice.Current current)
{
amdCB.ice_response(null);
}
示例11: findAdapterById_async
public override void findAdapterById_async(Ice.AMD_Locator_findAdapterById amdCB, String id, Ice.Current current)
{
amdCB.ice_response(null);
}
示例12: findObjectById_async
public override void findObjectById_async(Ice.AMD_Locator_findObjectById response, Ice.Identity id,
Ice.Current current)
{
_controller.checkCallPause(current);
response.ice_response(current.adapter.createDirectProxy(id));
}
示例13: setProperties_async
//.........这里部分代码省略.........
message.Append("\nNew properties:");
foreach(KeyValuePair<string, string> e in added)
{
message.Append("\n ");
message.Append(e.Key);
if(traceLevel > 1)
{
message.Append(" = ");
message.Append(e.Value);
}
}
}
if(changed.Count > 0)
{
message.Append("\nChanged properties:");
foreach(KeyValuePair<string, string> e in changed)
{
message.Append("\n ");
message.Append(e.Key);
if(traceLevel > 1)
{
message.Append(" = ");
message.Append(e.Value);
message.Append(" (old value = ");
message.Append(_properties.getProperty(e.Key));
message.Append(")");
}
}
}
if(removed.Count > 0)
{
message.Append("\nRemoved properties:");
foreach(KeyValuePair<string, string> e in removed)
{
message.Append("\n ");
message.Append(e.Key);
}
}
_logger.trace(_traceCategory, message.ToString());
}
//
// Update the property set.
//
foreach(KeyValuePair<string, string> e in added)
{
_properties.setProperty(e.Key, e.Value);
}
foreach(KeyValuePair<string, string> e in changed)
{
_properties.setProperty(e.Key, e.Value);
}
foreach(KeyValuePair<string, string> e in removed)
{
_properties.setProperty(e.Key, "");
}
//
// Send the response now so that we do not block the client during the call to the update callback.
//
cb.ice_response();
if(_updateCallbacks.Count > 0)
{
//
// Copy the callbacks to allow callbacks to update the callbacks.
//
List<Ice.PropertiesAdminUpdateCallback> callbacks =
new List<Ice.PropertiesAdminUpdateCallback>(_updateCallbacks);
Dictionary<string, string> changes = new Dictionary<string, string>(added);
foreach(KeyValuePair<string, string> e in changed)
{
changes.Add(e.Key, e.Value);
}
foreach(KeyValuePair<string, string> e in removed)
{
changes.Add(e.Key, e.Value);
}
foreach(Ice.PropertiesAdminUpdateCallback callback in callbacks)
{
try
{
callback.updated(changes);
}
catch(System.Exception)
{
// Ignore.
}
}
}
}
}