[CFSocket] When should a CFSocketRef be invalidated?
[CFSocket] When should a CFSocketRef be invalidated?
- Subject: [CFSocket] When should a CFSocketRef be invalidated?
- From: Stéphane Sudre <email@hidden>
- Date: Wed, 12 Jan 2011 21:05:16 +0100
Stupid question:
----------------
When should a CFSocketRef be invalidated in a network client
application?
----------
I have a process that uses CFSocketRef to connect to a TCP server and
get some data.
I'm using a run loop source and connect and data callbacks.
When I receive the final kCFSocketDataCallBack with a zero data
length, I invalidate the CFSocketRef.
In one case, it works.
In the other, it does not (it crashes).
Calling CFSocketIsValid before calling CFSocketInvalidate just makes
the code crash in CFSocketIsValid instead.
The connection is closed by the server in both cases after the server
provided the requested data.
The documentation did not help. The sample code did not help (most of
the sample code referenced by the documentation don't really use
CFSocketRef strangely or at least not with the callback mechanism for
a client).
_______________________________________________
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