Re: Bad things happening to listener CFSockets
Re: Bad things happening to listener CFSockets
- Subject: Re: Bad things happening to listener CFSockets
- From: Douglas Davidson <email@hidden>
- Date: Thu, 23 May 2002 10:23:44 -0700
On Thursday, May 23, 2002, at 09:22 AM, Avi Drissman wrote:
I'm working on porting my code to CFSockets and CFStreams. In my
current code, I'm using OT, and in the code to handle the listening
socket, I deal with events like T_LISTEN (of course), but also with
T_DISCONNECT and T_ORDREL. How do I get notification that something
happened to my socket via the CFSocket API? (The only mechanism would
be a callback, but the header says my callback will only be called for
incoming connections.)
CFSocket is based on BSD sockets, which don't map exactly to OT
concepts. What happens is that when a connection is accepted, a new
socket is created for it, and this new socket then represents that
connection. This is a BSD socket; you can deal with it using the BSD
APIs, you can create a CFSocket for it, or you can create a CFStream
pair for it--most likely the latter, with
CFStreamCreatePairWithSocket(). If the connection is broken, the
CFStream would then tell you about it.
Perhaps someone on the list with more OT experience can map this more
directly into OT terms for you.
Douglas Davidson
_______________________________________________
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.