Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSSocketPort vs. AF_UNIX?



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden

References: 
 >NSSocketPort vs. AF_UNIX? (From: Tom Harrington <email@hidden>)
 >Re: NSSocketPort vs. AF_UNIX? (From: Kaelin Colclasure <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.