由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - Is it possible to bind several sockets to 1 port?
相关主题
a socket questionHow to send packet on a chosen interface?THX!
multicaste programming help哪位大虾给偶讲讲socket?
help! cannot bind to socket!who knows how to use nslookup?
[转载] ifconfig 一问 问一个通过socket 获得request source IP的问题
a difficult question怎么用一个UDP的port来接收和发送信息?
dynamic assigned port number for UDP socket, need help!command line socket tools
socket编程问题紧急求助!
[转载] how to unbind a socket?Re: how to close port/socket from parent process?help!!!!!!!!!
相关话题的讨论汇总
话题: bind话题: so话题: sockets话题: port话题: udp
进入Unix版参与讨论
1 (共1页)
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.
:
: 到: 】

1 (共1页)
进入Unix版参与讨论
相关主题
Re: how to close port/socket from parent process?help!!!!!!!!!a difficult question
Have anyone installed FreeBSD on your PCdynamic assigned port number for UDP socket, need help!
ÇëÎÊ在C里如何把一个UDP的socket设置成nonblocking模式?socket编程问题
Re: ÇëÎÊ在C里如何把一个UDP的socket设置成nonblo[转载] how to unbind a socket?
a socket questionHow to send packet on a chosen interface?THX!
multicaste programming help哪位大虾给偶讲讲socket?
help! cannot bind to socket!who knows how to use nslookup?
[转载] ifconfig 一问 问一个通过socket 获得request source IP的问题
相关话题的讨论汇总
话题: bind话题: so话题: sockets话题: port话题: udp