阅读背景:

在linux上,当使用C执行端口0的套接字绑定(选择一个随机端口)时,我将得到errno 98,已经在使用的地址。这怎么可能?

来源:互联网 

So, we have a long standing commercial product, that is well established and I've never seen this type of issue before. We use a client program to send data to a server. Sometimes, because of firewalls in customer environments, we allow the end user to specify outbound port ranges to bind, however, in this particular issue i'm seeing, we're not doing that, and are using port 0 to perform a bind. From everything i've read, this means to pick a random port. But what I can't find out is, what does that mean to the kernel/OS. If i'm asking for a random port, how can that already be in use? Strictly speaking, only the unique pairing of src ip/src port & dst ip/port make the connection unique. I believe the same port can be used, if talking to another destination ip, but maybe that's not relevant here. So, we have a long standing commercial product,




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: