Re: udp port sharing across processes on OS X?
Re: udp port sharing across processes on OS X?
- Subject: Re: udp port sharing across processes on OS X?
- From: "Justin C. Walker" <email@hidden>
- Date: Wed, 31 May 2006 21:58:44 -0700
On May 31, 2006, at 21:44 , Michelle Munson wrote:
By setting the socket options SO_REUSEADDR and
SO_REUSEPORT, I've been able to successfully get two
instances of the same process running as the same user
to bind and share the same UDP port on OS X. However,
if the two instances of the process are running as
different user ids, the bind attempt by the second
instance of the process fails with "address already in
use". Does anyone know if there is way to get two
instances of the same process running as different
user ids to reuse the same UDP port on Mac OS X?
As I understand this issue, it is not possible. The options you
mention are provided to permit the "same service" to restart without
having to worry about stray packets for *that* service coming in
after the service instance that would receive those packets has
terminated (a long sentence; forgive me).
Mac OS X/Darwin (and most BSD-derived systems that I'm aware of)
treat the port space as a system-wide resource, and the port is used
(with the destination IP address) to demux incoming UDP or TCP
frames. Thus, you can't share ports across different "services".
Note also the implicit assumption that there really is at most one
recipient, at any point in time, for a UDP packet addressed to a
given (IP/port) pair.
Regards,
Justin
--
Justin C. Walker, Curmudgeon at Large
Institute for the Absorption of Federal Funds
-----------
I'm beginning to like the cut of his jibberish.
-----------
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden