NSNetService connection difficulty
NSNetService connection difficulty
- Subject: NSNetService connection difficulty
- From: Cate Tony <email@hidden>
- Date: Sat, 04 Oct 2008 08:41:47 -0500
I've created a small server that appears to set up and publish itself.
I then created a small client app that 'sees' the server but fails to
connect. The error I'm getting is: Address family not supported by
protocol family. The address->sa_family is AF_INET. The socket type
is: SOCK_STREAM.
Relevant code (I think):
remoteSocket = socket(socketAddress->sa_family, SOCK_STREAM, 0);
if ( remoteSocket > 0 )
remoteFile = [[NSFileHandle alloc]
initWithFileDescriptor:remoteSocket closeOnDealloc:YES];
if ( remoteFile ){
connectResult = connect(remoteSocket, (struct sockaddr
*)&socketAddress, sizeof(*socketAddress));
NSLog (@"%s\n", strerror (errno));
}
Some questions:
How do I tell what protocols an address family supports (or vise versa)?
Do I have to add support for the family to the protocol? If so, any
pointers to how?
Am I missing something simple or obvious?
Tony
3CAAM
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden