Re: Address from NSSocketPort
Re: Address from NSSocketPort
- Subject: Re: Address from NSSocketPort
- From: j o a r <email@hidden>
- Date: Wed, 19 Jun 2002 19:24:35 +0200
Right on!
Thanks to Sherm Pendley and Douglas Davidson for providing me with the correct answer!
j o a r
On Wednesday, Jun 19, 2002, at 01:27 Europe/Stockholm, Sherm Pendley wrote:
struct sockaddr_in addrIn = *(struct sockaddr_in *)addrData;
I think your problem is this line. You can't simply typecast an NSData pointer to get at the data the object contains. Instead, you call NSData's "bytes" method, which returns a pointer to the data, like this:
struct sockaddr_in addrIn = *(struct sockaddr_in *)[addrData bytes];
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.