w********r 发帖数: 6 | 1 上次的问题已经找到原因了.
就是我试图要把几个socket都binding到同一个
地址(IP& port).
写的时候没注意... 就出了那种情况.
我想是应该有办法做到这一点的. seems apache did so.
有人有这方面的经验么?
恳请指点一二. |
s******s 发帖数: 35 | 2 in TCP programming you need to use mutiple bindings to the
same ports when
1. you have a server started->spawned children->server
terminated but children still running. and you want to
restart the server.
2. you are a multiple-homed host, that is u have more than
one IP addr in your host and you want to bind to more than
on IP addresses smultanously. like the case of a web
server.
You can do this with a SO_REUSEADDR socket option on.
if u r trying UDP or Multicasting, I do not know the
det
【在 w********r 的大作中提到】 : 上次的问题已经找到原因了. : 就是我试图要把几个socket都binding到同一个 : 地址(IP& port). : 写的时候没注意... 就出了那种情况. : 我想是应该有办法做到这一点的. seems apache did so. : 有人有这方面的经验么? : 恳请指点一二.
|
m*******m 发帖数: 182 | 3 And SO_REUSEPORT.
You dont normally need bind in an UDP case. (It is
specified in the sockaddr when you call recv() or
recvfrom()) Multicast is a special case for UDP.
到: 】
【在 s******s 的大作中提到】 : in TCP programming you need to use mutiple bindings to the : same ports when : 1. you have a server started->spawned children->server : terminated but children still running. and you want to : restart the server. : 2. you are a multiple-homed host, that is u have more than : one IP addr in your host and you want to bind to more than : on IP addresses smultanously. like the case of a web : server. : You can do this with a SO_REUSEADDR socket option on.
|
w********r 发帖数: 6 | 4 in compliation, the system said that
SO_REUSEPORT is an unknown parameter.
is SO_REUSEADDR itself enough?
【在 m*******m 的大作中提到】 : And SO_REUSEPORT. : You dont normally need bind in an UDP case. (It is : specified in the sockaddr when you call recv() or : recvfrom()) Multicast is a special case for UDP. : : 到: 】
|