本文整理汇总了C#中Ice.ice_router方法的典型用法代码示例。如果您正苦于以下问题:C# Ice.ice_router方法的具体用法?C# Ice.ice_router怎么用?C# Ice.ice_router使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ice
的用法示例。
在下文中一共展示了Ice.ice_router方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: get
//
// Returns router info for a given router. Automatically creates
// the router info if it doesn't exist yet.
//
public RouterInfo get(Ice.RouterPrx rtr)
{
if(rtr == null)
{
return null;
}
//
// The router cannot be routed.
//
Ice.RouterPrx router = Ice.RouterPrxHelper.uncheckedCast(rtr.ice_router(null));
lock(this)
{
RouterInfo info = null;
if(!_table.TryGetValue(router, out info))
{
info = new RouterInfo(router);
_table.Add(router, info);
}
return info;
}
}
示例2: setServerEndpoints
private EndpointI[] setServerEndpoints(Ice.ObjectPrx serverProxy)
{
lock(this)
{
if(serverProxy == null)
{
throw new Ice.NoEndpointException();
}
serverProxy = serverProxy.ice_router(null); // The server proxy cannot be routed.
_serverEndpoints = ((Ice.ObjectPrxHelperBase)serverProxy).reference__().getEndpoints();
return _serverEndpoints;
}
}
示例3: erase
//
// Returns router info for a given router. Automatically creates
// the router info if it doesn't exist yet.
//
public RouterInfo erase(Ice.RouterPrx rtr)
{
RouterInfo info = null;
if(rtr != null)
{
//
// The router cannot be routed.
//
Ice.RouterPrx router = Ice.RouterPrxHelper.uncheckedCast(rtr.ice_router(null));
lock(this)
{
if(_table.TryGetValue(router, out info))
{
_table.Remove(router);
}
}
}
return info;
}
示例4: setClientEndpoints
private EndpointI[] setClientEndpoints(Ice.ObjectPrx clientProxy)
{
lock(this)
{
if(_clientEndpoints == null)
{
if(clientProxy == null)
{
//
// If getClientProxy() return nil, use router endpoints.
//
_clientEndpoints = ((Ice.ObjectPrxHelperBase)_router).reference__().getEndpoints();
}
else
{
clientProxy = clientProxy.ice_router(null); // The client proxy cannot be routed.
//
// In order to avoid creating a new connection to the
// router, we must use the same timeout as the already
// existing connection.
//
if(_router.ice_getConnection() != null)
{
clientProxy = clientProxy.ice_timeout(_router.ice_getConnection().timeout());
}
_clientEndpoints = ((Ice.ObjectPrxHelperBase)clientProxy).reference__().getEndpoints();
}
}
return _clientEndpoints;
}
}