Re: Trouble getting SSD Project working & Questions
Re: Trouble getting SSD Project working & Questions
- Subject: Re: Trouble getting SSD Project working & Questions
- From: email@hidden
- Date: Mon, 25 Jul 2011 05:47:13 -0500
On Mon, 25 Jul 2011 10:55:43 +0100, Quinn "The Eskimo!" wrote:
On 24 Jul 2011, at 19:48, email@hidden wrote:
How can one know on which socket the data will be on?
A server that supports IPv4 and IPv6 is expected to listen on both
sockets equally. You just can't tell which socket the client will
choose to connect on.
Interesting. So, the ssd sample code is incorrect when it chooses to
close the the IPv6 socket. I can file a bug report on this so the sample
code can be updated.
I was reading the "launchd.plist" man page and saw:
SockFamily <string>
This optional key can be used to specifically request
that "IPv4" or "IPv6" socket(s) be created.
So, I tried putting into my server plist:
<key>SockFamily</key>
<string>IPv4</string>
to specify the connection should be on the IPv4 socket and then
changed:
launch_data_t sockv4 = launch_data_array_get_index( sarr, 1 );
to:
launch_data_t sockv4 = launch_data_array_get_index( sarr, 0 );
and commented out the code referring to sockv6 and it worked.
Am I correct in thinking this would be the way to keep the sample code
as-is and force the connection to the IPv4 socket?
However, another possible fix for the sample code as it stands would be
for server_check_in to return the fd for both the IPv4 and IPv6 sockets
and then to set up a DISPATCH_SOURCE_TYPE_READ handler for both fd's. I
haven't tried this yet, but I assume it would work. Correct?
Thank you for your assistance and patience in explaining this stuff.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden