• 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
Re: CFSocket client side exc_bad_access
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Jens Alfke <email@hidden>
Date: Tuesday, March 18, 2014 11:12
To: Jeremy Thompson <email@hidden>
Cc: <email@hidden>
Subject: Re: CFSocket client side exc_bad_access


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

References: 
 >Re: CFSocket client side exc_bad_access (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: CFSocket client side exc_bad_access
  • Next by Date: Re: CFSocket client side exc_bad_access
  • Previous by thread: Re: CFSocket client side exc_bad_access
  • Next by thread: Re: CFSocket client side exc_bad_access
  • Index(es):
    • Date
    • Thread