Re: NSSocketPort vs. AF_UNIX?
Re: NSSocketPort vs. AF_UNIX?
- Subject: Re: NSSocketPort vs. AF_UNIX?
- From: Tom Harrington <email@hidden>
- Date: Tue, 30 Aug 2005 17:48:04 -0600
On 8/30/05, Kaelin Colclasure <email@hidden> wrote:
> On Aug 30, 2005, at 4:09 PM, Tom Harrington wrote:
> > struct sockaddr_un name;
> > memset(&name, 0, sizeof(struct sockaddr_un));
> > name.sun_family = AF_UNIX;
> > strcpy(name.sun_path, "/tmp/af_unix.test");
> > int len = sizeof(name.sun_family) + strlen(name.sun_path);
> >
> > NSData *addrData = [NSData dataWithBytes:&name length:len];
> >
> > But that didn't work any better.
>
> Try changing that last line to:
>
> NSData * addrData = [NSData dataWithBytes:&name length:sizeof
> (name)];
That seems to do it. I was using "len" because that's what I'd
normally pass to bind(), but I guess that's not what I needed here.
Thanks.
--
Tom Harrington
email@hidden
AIM: atomicbird1
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden