Re: kCFSocketDataCallBack auto accepts connection?
Re: kCFSocketDataCallBack auto accepts connection?
- Subject: Re: kCFSocketDataCallBack auto accepts connection?
- From: Quinn <email@hidden>
- Date: Thu, 9 Oct 2008 09:49:02 +0100
At 3:27 +0800 9/10/08, Liwei wrote:
I read that kCFSocketDataCallBack and kCFSocketAcceptCallBack are
mutually exclusive callback types and that kCFSocketAcceptCallBack is
called when a connection is automatically accepted and data is read.
Does this imply that kCFSocketDataCallBack also automatically accepts
an incoming connection? If not, then how do I know of an incoming
connection? I'm using TCP in this case.
In general you use a CFSocket with kCFSocketAcceptCallBack to listen
for and accept new incoming connections. You can then use either a
CFStream (created with CFStreamCreatePairWithSocket) or a CFSocket
(created with CFSocketCreateWithNative and with either
kCFSocketDataCallBack or kCFSocketReadCallBack set) to manage each
specific connection.
S+E
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
_______________________________________________
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