Re: CFSocket questions
Re: CFSocket questions
- Subject: Re: CFSocket questions
- From: Becky Willrich <email@hidden>
- Date: Tue, 10 Sep 2002 10:39:18 -0700
We need to see the construction of sc to know what's going wrong. For
instance, have you properly set the retain and release functions? The
retain function will immediately be called on the info pointer, as
realInfoPointer = sc.retain(sc.info);
It's whatever's returned by sc.retain that will be given back to you in
the callbacks....
REW
On Monday, September 9, 2002, at 09:09 PM, Edward Fink wrote:
I have tried what you suggested but apparently I am doing something
wrong. I understand the concept and it seems like a great solution,
however I must be missing something. I have tried many different ways
but I cannot seem to get the info pointer assigned within the
CFSocketContext to my object. I've looked at the CFSocket header file
and the echo example in the developer docs but haven't figured it out.
The program keeps crashing right when it does the CFSocketCreate w/my
new CFSocketContext (shown below). Any help/suggestions would be
great.
CFSocketRef s = CFSocketCreate(NULL, PF_INET, SOCK_STREAM,
IPPROTO_TCP,
kCFSocketDataCallBack |
kCFSocketConnectCallBack,
whatToDo, &sc);
On Monday, September 9, 2002, at 12:36 PM, Douglas Davidson wrote:
For example: when you create the CFSocket, you can pass it a
CFSocketContext whose info is a pointer to the object you want to pair
with this particular socket. If you want the CFSocket to retain that
object, then you can set the retain and release pointers; otherwise
you can leave them NULL. When you get a callback, the last argument
to the callback function is that info pointer. Cast it to the type of
the object you are using, and then you can send messages to it.
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.