本文整理汇总了C#中IceInternal.Instance.outgoingConnectionFactory方法的典型用法代码示例。如果您正苦于以下问题:C# Instance.outgoingConnectionFactory方法的具体用法?C# Instance.outgoingConnectionFactory怎么用?C# Instance.outgoingConnectionFactory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IceInternal.Instance
的用法示例。
在下文中一共展示了Instance.outgoingConnectionFactory方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ObjectAdapterI
//.........这里部分代码省略.........
if(_routerInfo != null)
{
//
// Make sure this router is not already registered with another adapter.
//
if(_routerInfo.getAdapter() != null)
{
Ice.AlreadyRegisteredException ex = new Ice.AlreadyRegisteredException();
ex.kindOfObject = "object adapter with router";
ex.id = instance_.identityToString(router.ice_getIdentity());
throw ex;
}
//
// Add the router's server proxy endpoints to this object
// adapter.
//
EndpointI[] endpoints = _routerInfo.getServerEndpoints();
for(int i = 0; i < endpoints.Length; ++i)
{
_routerEndpoints.Add(endpoints[i]);
}
_routerEndpoints.Sort(); // Must be sorted.
//
// Remove duplicate endpoints, so we have a list of unique endpoints.
//
for(int i = 0; i < _routerEndpoints.Count-1;)
{
EndpointI e1 = _routerEndpoints[i];
EndpointI e2 = _routerEndpoints[i + 1];
if(e1.Equals(e2))
{
_routerEndpoints.RemoveAt(i);
}
else
{
++i;
}
}
//
// Associate this object adapter with the router. This way,
// new outgoing connections to the router's client proxy will
// use this object adapter for callbacks.
//
_routerInfo.setAdapter(this);
//
// Also modify all existing outgoing connections to the
// router's client proxy to use this object adapter for
// callbacks.
//
instance_.outgoingConnectionFactory().setRouterInfo(_routerInfo);
}
}
else
{
//
// Parse the endpoints, but don't store them in the adapter. The connection
// factory might change it, for example, to fill in the real port number.
//
List<EndpointI> endpoints = parseEndpoints(properties.getProperty(_name + ".Endpoints"), true);
foreach(EndpointI endp in endpoints)
{
IncomingConnectionFactory factory = new IncomingConnectionFactory(instance, endp, this);
_incomingConnectionFactories.Add(factory);
}
if(endpoints.Count == 0)
{
TraceLevels tl = instance_.traceLevels();
if(tl.network >= 2)
{
instance_.initializationData().logger.trace(tl.networkCat, "created adapter `" + _name +
"' without endpoints");
}
}
//
// Parse published endpoints.
//
_publishedEndpoints = parsePublishedEndpoints();
}
if(properties.getProperty(_name + ".Locator").Length > 0)
{
setLocator(LocatorPrxHelper.uncheckedCast(
instance_.proxyFactory().propertyToProxy(_name + ".Locator")));
}
else
{
setLocator(instance_.referenceFactory().getDefaultLocator());
}
}
catch(LocalException)
{
destroy();
throw;
}
}