Re: CFSocket client side exc_bad_access
Re: CFSocket client side exc_bad_access
- Subject: Re: CFSocket client side exc_bad_access
- From: Jeremy Thompson <email@hidden>
- Date: Tue, 18 Mar 2014 11:30:48 -0700
- Thread-topic: CFSocket client side exc_bad_access
It look like I was looking at the client side a little backwards. After taking passed_req and passing a size along with it I was able to create a CFDataRef and load the buffer into it. I guess I could use a little more coffee :). Thanks for pointing me back in the right direction.
~Jeremy
On Mar 18, 2014, at 10:47 AM, Jeremy Thompson < email@hidden> wrote: When the client software calls to send data it does so through a void pointer. Void *passed_req
CFDataRef sf = (CFDataRef) passed_req; int slen = CFDataGetLength(sf);
Once I try and get the length of the passed_req I get a bad access error.
Are you saying that the caller has a CFDataRef already but passes it through a void* parameter, and then the code you showed is just casting that pointer back to a CFDataRef? Then that should work fine. But if the caller is just passing a raw pointer to a data block, you can’t legally cast that to a CFDataRef, because it isn’t one.
If this isn’t what’s going on, then you should post some more code for context.
—Jens
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden