Re: Datagram Socket Reading?
Re: Datagram Socket Reading?
- Subject: Re: Datagram Socket Reading?
- From: Douglas Davidson <email@hidden>
- Date: Thu, 16 May 2002 18:55:05 -0700
On Friday, May 10, 2002, at 04:09 PM, RR wrote:
Paul I have looked into this issue extensively and there really are no
feature-complete, Apple-supplied ObjC classes suited for socket
communication. And I sort of poked around with OmniNetworking which
looks like an awesome set of goodies, but far more than I need
presently.
And in addition, I will swear on my dear grandfather's grave that I
read once somewhere on developer.apple.com that the official
recommendation for socket programming is to use the BSD layer
functions. However I now cannot find reference to this statement at
all!
So creating a new, blocking thread appears to be the way to go. To
that end, you should go immediately and acquire a copy of W. Richard
Stevens' Unix Network Programming Volume 1. It is without a doubt the
most thorough book on Unix sockets programming available.
No, you don't need that extra thread. You can use CFSocket for this.
CFSocket is a CF type intended to allow sockets of more or less
arbitrary type to serve as run loop sources. Note that CFSocket is not
intended as a complete wrapper around the BSD sockets APIs; you still
deal with a socket as usual, but you can be notified in your run loop
e.g. when data arrives. There was a session at the recent WWDC that
discussed this, among other issues. I'll see if I can put together some
sample code for the UDP case.
Douglas Davidson
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.