简体   繁体   English

通过绑定接口使用ACE框架

[英]Using ACE framework with bind interface

I have Linux server with one physical interface eth0 and 3 virtuals eth1, eth2, eth3 . 我有一个具有一个物理接口eth0和3个虚拟接口eth1, eth2, eth3 Linux服务器。 Server has 4 IP addresses, it is necessary to use a lot IP ports (more than 100k). 服务器有4个IP地址,必须使用很多IP端口(超过100k)。 Server has bond0 interface with 4 addresses, for example .1 , .2 , .3 and .4 . 服务器具有具有4个地址的bond0接口,例如.1.2.3.4 My application based on ACE v5.5. 我的应用程序基于ACE v5.5。 To open an local 1023 port I use ACE_SOCK_Dgram class with ctor argument ACE_Addr = ACE_INET_Addr("0.0.0.0:1023") . 要打开本地1023端口,请使用带有ctor参数ACE_Addr = ACE_INET_Addr("0.0.0.0:1023") ACE_SOCK_Dgram类。 It works. 有用。 How to open 1023 on another local IP? 如何在另一个本地IP上打开1023

Thanks. 谢谢。

I found the solution. 我找到了解决方案。 Using ACE_INET_Addr("xxx1:1023") , ACE_INET_Addr("xxx2:1023") , ACE_INET_Addr("xxx2:1024") , etc in ACE_SOCK_Dgram ctor param provide your application to use different IP addresses and different ports. 使用ACE_SOCK_Dgram ctor参数中的ACE_INET_Addr("xxx1:1023")ACE_INET_Addr("xxx2:1023")ACE_INET_Addr("xxx2:1024")等,可以为您的应用程序使用不同的IP地址和不同的端口。 You can manage port and address as you like. 您可以根据需要管理端口和地址。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM