Re: Datagram Socket Reading?
Re: Datagram Socket Reading?
- Subject: Re: Datagram Socket Reading?
- From: Douglas Davidson <email@hidden>
- Date: Fri, 10 May 2002 10:37:55 -0700
On Thursday, May 9, 2002, at 11:58 PM, Paul A. Seligman wrote:
I'm looking to write a wrapper for a UDP socket. What I'd like to do is
to set up a socket with a particular server, write to it once (and
process an expected response). That seems easy enough. My problem is
how to sit and wait for an asynchronous message
from my server after the initial communication. NSFileHandle seemed
like the obvious choice, but the documentation mentions that it is
incompatible with datagram sockets.
It seems I've got two options. I can make a new thread that attempts to
read from the server, which'll hang indefinately until I receive a
message. Or, I can find someone who knows enough about OmniNetworking
to tell me that there's a way to do it there.
CFSocket can be used for this purpose. CFSocket is a
CoreFoundation-level API, a CFType that allows a socket of essentially
arbitrary type to serve as a run loop source.
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.