Re: Kernel log: app uses send/recv on a pipe
Re: Kernel log: app uses send/recv on a pipe
- Subject: Re: Kernel log: app uses send/recv on a pipe
- From: Tomasz Kukielka <email@hidden>
- Date: Wed, 29 Nov 2006 18:46:57 -0800
- Thread-topic: Kernel log: app uses send/recv on a pipe
Thanks a bunch for this tip! Ironically, this was my original implementation
but then I thought that the kCFSocketDataCallBack is more elegant because I
get a ready CFDataRef while kCFSocketReadCallBack required reading unknown
amount of data (and I was afraid that I may block in read call if no data
available). I did not notice that the kernel warning happened only after I
switched to CFDataRef. This solves my problem.
On a related note I wish it was possible to to create CFReadStream directly
from file descriptor or FILE * stream (Cocoa NSFileHandle can
initWithFileDescriptor)
Thanks,
Tom
On 11/29/06 2:31 PM, "Quinn" <email@hidden> wrote:
> At 10:39 -0800 29/11/06, Vincent Lubet wrote:
>> The alternative is to use socketpair(2)
>
> Or tell CFSocket /not/ to read the data for you (use
> kCFSocketReadCallBack instead of kCFSocketDataCallBack), in which
> case it will only notify you when data is available and leave you to
> read the actual data. Your callback can then read the data using
> <x-man-page://2/read> and avoid the message.
>
> S+E
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden