Re: Timeouts on CFWriteStreams
Re: Timeouts on CFWriteStreams
- Subject: Re: Timeouts on CFWriteStreams
- From: Jeremy Wyld <email@hidden>
- Date: Mon, 3 Mar 2003 15:19:56 -0800
CFStream does no buffering, so it'll be the kernel's socket buffer.
Is this still a great problem? At some point, you will timeout waiting
to fill the buffer again (it's full) or waiting to hear back from the
server. Either way, the timer should fire for you.
If you're using a CFSocketStream, you should receive a read event at
some point. When you attempt to read, you should get a zero.
jeremy
On Monday, March 3, 2003, at 3:00 PM, Ulrich Bauer wrote:
On Tuesday, February 25, 2003, at 8:02 AM, Ulrich Bauer wrote:
how do I set write timeouts on CFWriteStreams? When the remote side
loses the connection unexpectedly, I don't get any notification, and
I still get kCFStreamEventCanAcceptBytes events. How can I find out
that the Stream does not send the bytes anymore?
On Montag, Mdr 3, 2003, at 20:05 Europe/Berlin, Jeremy Wyld wrote:
You should set up the stream for asynchronous usage (set a client and
schedule on a run loop) and create a run loop timer which will fire
after a certain amount of time. When you write bytes, you simply
reset the timer to fire in the future.
You should look at the Echo example (specifically EchoContext.c) on
how to do this.
OK, I'm already using asynchronous CFStream; my problem is that I get
kCFStreamEventCanAcceptBytes events even after the remote side has
died, apparently until some buffer is full (CFStream buffer or kernel
socket buffer, I can't tell).
Thanks for your info,
--
Ulrich Bauer Mail: email@hidden
Lehrstuhl f|r Angewandte Softwaretechnik Tel.: +49 (89) 289-18240
Institut f|r Informatik Raum: 01.07.039
Technische Universitdt M|nchen PGP ID: 0361C54B
_______________________________________________
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.