Overview
| Artifact ID: | b25c5989844bda5bb002070410986c693b561627 |
|---|---|
| Ticket: | 2936225fffffffffffffffffffffffffffffffff
[chan copy] overruns slow receiver |
| User & Date: | ferrieux on 2010-03-08 08:16:25 |
Changes
- icomment:
Got it. The hole in the reflection API consists, as suspected earlier, in the inability for the reflected channel to tell its writer EWOULDBLOCK. Indeed, proper async fcopy function requires that the output channel get its BG_FLUSH_SCHEDULED switched on, which tells fcopy to refrain from writing until a fileevent writable fires. But for this flag to be set, in FlushChannel at tclIO.c+2346, an errorCode==EWOULDBLOCK (or EAGAIN) must be detected. While this occurs routinely for normal, fd-based channels, so such thing can happen for a reflected channel, which is a pure script thing... To keep the API simple, I suggest to simply define the -1 return value from [write] to mean EWOULDBLOCK. A typical refchan like colin's would use [chan pending output] on its underlying (nonblocking & unbuffered) fd to decide whether or not to send this signal upstream.
- login: "ferrieux"
- mimetype: "text/plain"
- username: "ferrieux"