Re: Socket question
- From: "Boris" <spamno@xxxxxxxxxx>
- Date: Thu, 11 Dec 2008 14:25:38 -0800
"Alun Jones" <alun@xxxxxxxxxxxxx> wrote in message news:OUzDcY6WJHA.4384@xxxxxxxxxxxxxxxxxxxxxxx
"m" <m@xxx> wrote in message news:#CAFxcNWJHA.1576@xxxxxxxxxxxxxxxxxxxxxxxThat's right. However, you need to explicitly bind sockets to specific port for that (so that more than one outbound socket use same src port) and use SO_REUSEADDR option. Without such explicit steps, same src port won't be used by multiple sockets.False!
<snip>
because no 2 sockets share same
source IP/source port</snip>
This is only true for outbound connections. A server app has many sockets with the same local IP and port.
This isn't even true for outbound connections.
The only guarantee of uniqueness necessary (or provided) is that the combination of { protocol, source address, source port, destination address, destination port } is unique.
What may have confused you is that an unconnected socket has destination address and port set to 0, but again, those sockets only need to be unique if they are used as TCP listeners or unicast UDP receivers.
Boris
.
- References:
- Socket question
- From: Yoo
- Re: Socket question
- From: Boris
- Re: Socket question
- From: m
- Re: Socket question
- From: Alun Jones
- Socket question
- Prev by Date: Re: Socket question
- Next by Date: RE: Starting and stopping RAS service in VB6 using APIs
- Previous by thread: Re: Socket question
- Next by thread: Re: Programming Services Error: Some services stop automatically ...
- Index(es):
Relevant Pages
|