• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSNetService connection difficulty
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: Help for a beginner..
  • Next by Date: Re: file fixtures for unit testing
  • Previous by thread: Re: NSTreeController rearrangeObjects doesn't always trigger sorting
  • Next by thread: Clueless about this warning
  • Index(es):
    • Date
    • Thread