On 1月19日, 下午5时41分, cherokee <tech...@gmail.com> wrote:
> client连接server,调用server上的对象并执行方法,发现当server计算机配置了多个ip地址时,会使得执行时间长达数十秒,这是什么原因-,如何避免呢?
This option allows clients running on a multihomed host to pick a local network/interface to communicate with a remote target. When TAO attempts to establish a connection with a host matching targetNetwork, then it will use the local ip address matching localNetwork. Simple wildcards can be used for both parameters, and multiple preferred interfaces can be specified using comma separators. For example, for a machine with two network cards identified by the ip addresses 192.168.1.10 and 192.168.1.20, you can use -ORBPreferredInterfaces *=*10,*=*20. Or to force all communication on the loopback address to try to first use the loopback address, use -ORBPreferredInterfaces 127.0.0.1=127* . targetNetwork can use any string, and must typically match with the value read from an IOR. localNetwork must use a dotted decimal address, because it will be matched with the local ip interfaces.
-ORBEnforcePreferredInterfaces
1
(true), then TAO will only try to use the interfaces specified by the -ORBPreferredInterfaces
option. The default is 0
(false), in which case if a connection cannot be made using a preferred interface, TAO will attempt to use the default interface (INADDR_ANY
). Note: If none of the preferred interfaces apply to an outgoing connection then they will not be enforced. For this option to have any effect, therefore, the connection through a legal preferred interface must fail. On 3月16日, 下午12时07分, Stone Jiang <2005...@gmail.com> wrote:
> 由于我无法重现你的网络环境,所以这个问题一直没法帮得上你。
>
> 官方文档中提供了一些关于连接管理的选项,其中有两个选项与多网卡有关。我转贴如下
> -ORBPreferredInterfaces *"targetNetwork:localNetwork,.."*
>
> This option allows clients running on a multihomed host to pick a local
> network/interface to communicate with a remote target. When TAO attempts to
> establish a connection with a host matching targetNetwork, then it will use
> the local ip address matching localNetwork. Simple wildcards can be used for
> both parameters, and multiple preferred interfaces can be specified using
> comma separators. For example, for a machine with two network cards
> identified by the ip addresses 192.168.1.10 and 192.168.1.20, you can use
> -ORBPreferredInterfaces *=*10,*=*20. Or to force all communication on the
> loopback address to try to first use the loopback address, use
> -ORBPreferredInterfaces 127.0.0.1=127* . *targetNetwork* can use any string,
> and must typically match with the value read from an IOR. *localNetwork* must
> use a dotted decimal address, because it will be matched with the local ip
> interfaces.
>
> -ORBEnforcePreferredInterfaces
> *boolean (0|1)*
>
> If this option is set to 1(true), then TAO will only try to use the
> interfaces specified by the -ORBPreferredInterfaces option. The
> default is 0(false),
> in which case if a connection cannot be made using a preferred interface,
> TAO will attempt to use the default interface (INADDR_ANY). Note: If none of
> the preferred interfaces apply to an outgoing connection then they will not
> be enforced. For this option to have any effect, therefore, the connection
> through a legal preferred interface must fail.
>
> 但上述方法你是否已经测试过?有人说这个选项无效。 你可以试试。
> 我的确遇到过在装有虚拟机的环境下第一次建立连接很慢的问题,当禁用一块不用的网卡则速度飞快。
> 如果不禁用不用的网卡,我是在
> /etc/host文件中(windows在system32/drivers/host)中,增加了参与通讯的机器的ip和名字对应的条目,这样也能解决上述-问题。
> 这个方法似乎你有人也说无效,你可以试试看。
>
> 2009/3/16 techabc <tech...@gmail.com>
>
>
>
> > 遇到这个问题的弟兄们越来越多,这个问题应该比较普遍,各位对tao比较熟悉的朋友们应该有解决办法吧,请大家都来谈谈经验吧
>
> > 2009/3/12 sapy <chengdongx...@gmail.com>
>
> > 我也遇到了,当server是2个ip是要消耗20s,禁用一个ip后,速度马上就快了
> >> 恳请高手给个解决方案啊,
> >> 油箱chengdongx...@gmail.com
>
> >> On 1月19日, 下午5时41分, cherokee <tech...@gmail.com> wrote:
>
> >> client连接server,调用server上的对象并执行方法,发现当server计算机配置了多个ip地址时,会使得执行时间长达数十秒,这是什么原因--,如何避免呢?- 隐藏被引用文字 -
>
> - 显示引用的文字 -
现象: C端----S端(地址1) 正常
C端----S端(地址1和地址2) 正常
C端----S端(地址1和地址3) 延迟20秒左右
使用命令:server.exe -ORBPreferredInterfaces *=*10.115,*=*11.115 -
ORBEnforcePreferredInterfaces 1 无改善
server.exe -ORBPreferredInterfaces 192.168.10.115=192.168.11.115 -
ORBEnforcePreferredInterfaces 1 无改善
总结:S端多IP与C端IP属于同一网段时无延迟,而S端多IP中存在与C端不同网段的IP时有延迟。
> > /etc/host文件中(windows在system32/drivers/host)中,增加了参与通讯的机器的ip和名字对应的条目,这样也能解决上述--问题。
> > 这个方法似乎你有人也说无效,你可以试试看。
>
> > 2009/3/16 techabc <tech...@gmail.com>
>
> > > 遇到这个问题的弟兄们越来越多,这个问题应该比较普遍,各位对tao比较熟悉的朋友们应该有解决办法吧,请大家都来谈谈经验吧
>
> > > 2009/3/12 sapy <chengdongx...@gmail.com>
>
> > > 我也遇到了,当server是2个ip是要消耗20s,禁用一个ip后,速度马上就快了
> > >> 恳请高手给个解决方案啊,
> > >> 油箱chengdongx...@gmail.com
>
> > >> On 1月19日, 下午5时41分, cherokee <tech...@gmail.com> wrote:
>
> > >> client连接server,调用server上的对象并执行方法,发现当server计算机配置了多个ip地址时,会使得执行时间长达数十秒,这是什么原因---,如何避免呢?- 隐藏被引用文字 -
>
> > - 显示引用的文字 -- 隐藏被引用文字 -
>
> - 显示引用的文字 -
CosNaming::Name name(1);
name.length(1);
name[0].id = CORBA::string_dup("EmsSessionFactory");
/***** resolve ****/
CORBA::Object_var factory_object = naming_context_var->resolve(name);
/***** 耗时80s ,-ORBEndpoint 已解决***/
emsSessionFactory::EmsSessionFactory_I_var emsSessionF_var=
emsSessionFactory::EmsSessionFactory_I::_narrow(factory_object.in
());
emsSessionF_var->getEmsSession("user","pass",nmsSession_var.in
(),emsSession_var);
if (!CORBA::is_nil(emsSession_var))
{
emsSession_var->getEventChannel(eventChannel);
}
// notify
CosNotifyChannelAdmin::EventChannel_var ec = eventChannel;
CosNotifyChannelAdmin::AdminID adminid;
CosNotifyChannelAdmin::InterFilterGroupOperator ifgop
=CosNotifyChannelAdmin::AND_OP;
/***** new_for_consumers ****/
CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin = ec-
>new_for_consumers(ifgop, adminid);
/***** 耗时 40s *****/
CORBA::Object_var poa_object = orb->resolve_initial_references
("RootPOA");
PortableServer::POA_var poa = PortableServer::POA::_narrow
(poa_object.in());
StructuredEventConsumer_i servant(orb.in());
PortableServer::ObjectId_var oid = poa->activate_object(&servant);
CORBA::Object_var consumer_obj = poa->id_to_reference(oid.in());
CosNotifyComm::StructuredPushConsumer_var consumer =
CosNotifyComm::StructuredPushConsumer::_narrow(consumer_obj.in());
CosNotifyChannelAdmin::ProxyID consumeradmin_proxy_id;
/***** obtain_notification_push_supplier ****/
CosNotifyChannelAdmin::ProxySupplier_var proxy_supplier =
consumer_admin->obtain_notification_push_supplier(
CosNotifyChannelAdmin::STRUCTURED_EVENT,
consumeradmin_proxy_id);
/***** 耗时40s *****/
// The proxy that we are connected to.
CosNotifyChannelAdmin::StructuredProxyPushSupplier_var supplier_proxy;
/***** _narrow ****/
supplier_proxy = CosNotifyChannelAdmin::Structure ProxyPushSupplier::
_narrow(proxy_supplier.in());
/***** 耗时40s *****/
supplier_proxy->connect_structured_push_consumer(consumer.in());
// end notify
PortableServer::POAManager_var poa_manager = poa->the_POAManager();
poa_manager->activate();
orb->destroy();
On 3月26日, 上午10时02分, Stone Jiang <2005...@gmail.com> wrote:
> 下面的论坛在解决描述了解决多网卡首次建立连接时延迟的问题
>
> http://www.tao-studio.net/bbs/viewthread.php?tid=28&extra=page%3D1
>
> 2009/3/25 dong cheng <chengdongx...@gmail.com>
>
>
>
> > 你好,能详细的说一下吗?
> > 我的情况是这样的,
> > server 192.168.6.100 和 16.3.4.2 其中16.3.4.2是我使用的ip
> > client 是 16.3.4.41
> > 我从client调用server上的方法的时候,如果禁用的掉192.168.6.100的话很快,否则要20s
>
> > 你说的第一个方法我试了,不管用,如果是采用第2个方法的话,具体应该怎么设置啊.
> > 是在client机器上的 /etc/host文件中 进行设置 16.3.4.2 hostname??
>
> > 多谢了
>
> > 2009/3/16 Stone Jiang <2005...@gmail.com>
>
> > 由于我无法重现你的网络环境,所以这个问题一直没法帮得上你。
>
> >> 官方文档中提供了一些关于连接管理的选项,其中有两个选项与多网卡有关。我转贴如下
> >> -ORBPreferredInterfaces *"targetNetwork:localNetwork,.."*
>
> >> This option allows clients running on a multihomed host to pick a local
> >> network/interface to communicate with a remote target. When TAO attempts to
> >> establish a connection with a host matching targetNetwork, then it will use
> >> the local ip address matching localNetwork. Simple wildcards can be used for
> >> both parameters, and multiple preferred interfaces can be specified using
> >> comma separators. For example, for a machine with two network cards
> >> identified by the ip addresses 192.168.1.10 and 192.168.1.20, you can use
> >> -ORBPreferredInterfaces *=*10,*=*20. Or to force all communication on the
> >> loopback address to try to first use the loopback address, use
> >> -ORBPreferredInterfaces 127.0.0.1=127* . *targetNetwork* can use any
> >> string, and must typically match with the value read from an IOR. *
> >> localNetwork* must use a dotted decimal address, because it will be
> >> matched with the local ip interfaces.
>
> >> -ORBEnforcePreferredInterfaces
> >> *boolean (0|1)*
>
> >> If this option is set to 1(true), then TAO will only try to use the
> >> interfaces specified by the -ORBPreferredInterfaces option. The default
> >> is 0(false), in which case if a connection cannot be made using a
> >> preferred interface, TAO will attempt to use the default interface (
> >> INADDR_ANY). Note: If none of the preferred interfaces apply to an
> >> outgoing connection then they will not be enforced. For this option to have
> >> any effect, therefore, the connection through a legal preferred interface
> >> must fail.
>
> >> 但上述方法你是否已经测试过?有人说这个选项无效。 你可以试试。
> >> 我的确遇到过在装有虚拟机的环境下第一次建立连接很慢的问题,当禁用一块不用的网卡则速度飞快。
> >> 如果不禁用不用的网卡,我是在
> >> /etc/host文件中(windows在system32/drivers/host)中,增加了参与通讯的机器的ip和名字对应的条目,这样也能解决上述-问题。
> >> 这个方法似乎你有人也说无效,你可以试试看。
>
> >> 2009/3/16 techabc <tech...@gmail.com>
>
> >> 遇到这个问题的弟兄们越来越多,这个问题应该比较普遍,各位对tao比较熟悉的朋友们应该有解决办法吧,请大家都来谈谈经验吧
>
> >>> 2009/3/12 sapy <chengdongx...@gmail.com>
>
> >>> 我也遇到了,当server是2个ip是要消耗20s,禁用一个ip后,速度马上就快了
> >>>> 恳请高手给个解决方案啊,
> >>>> 油箱chengdongx...@gmail.com
>
> >>>> On 1月19日, 下午5时41分, cherokee <tech...@gmail.com> wrote:
>
> >>>> client连接server,调用server上的对象并执行方法,发现当server计算机配置了多个ip地址时,会使得执行时间长达数十秒,这是什么原因--,如何避免呢?- 隐藏被引用文字 -
>
> - 显示引用的文字 -
> > >> /etc/host文件中(windows在system32/drivers/host)中,增加了参与通讯的机器的ip和名字对应的条目,这样也能解决上述--问题。
> > >> 这个方法似乎你有人也说无效,你可以试试看。
>
> > >> 2009/3/16 techabc <tech...@gmail.com>
>
> > >> 遇到这个问题的弟兄们越来越多,这个问题应该比较普遍,各位对tao比较熟悉的朋友们应该有解决办法吧,请大家都来谈谈经验吧
>
> > >>> 2009/3/12 sapy <chengdongx...@gmail.com>
>
> > >>> 我也遇到了,当server是2个ip是要消耗20s,禁用一个ip后,速度马上就快了
> > >>>> 恳请高手给个解决方案啊,
> > >>>> 油箱chengdongx...@gmail.com
>
> > >>>> On 1月19日, 下午5时41分, cherokee <tech...@gmail.com> wrote:
>
> > >>>> client连接server,调用server上的对象并执行方法,发现当server计算机配置了多个ip地址时,会使得执行时间长达数十秒,这是什么原因---,如何避免呢?- 隐藏被引用文字 -
>
> > - 显示引用的文字 -- 隐藏被引用文字 -
>
> - 显示引用的文字 -