Re: serving a file to a client --- background fcopy read fileevent event puts socket channel blocking nonblocking
- From: vitick@xxxxxxxxx
- Date: Fri, 28 Mar 2008 18:08:29 -0700 (PDT)
On Mar 28, 5:32 pm, Alan Anderson <arand...@xxxxxxxxxxxxx> wrote:
In article
<3c69be6e-ce92-4f23-9103-48da5f1fb...@xxxxxxxxxxxxxxxxxxxxxxxxxxx>,
vit...@xxxxxxxxx wrote:
It looks like the only way to reliably do what I was trying to do is
to learn the Threads extension of TCL.
May I propose a better way? Learn how to work *with* the event loop
rather than fighting it. Start small. Try doing one thing, and post
here your solution. If feedback from some of the more experienced folk
here is positive, add one more thing, post here, repeat.
Based on the code you posted already, it's likely that feedback will
take the form of constructive suggestions on what to change in order to
make it work better. For example, I can think of no good reason *ever*
to write an infinite loop in an interactive Tcl application. I think
you might find that there is a teeny bit of misunderstanding on your
part regarding the "proper" way to do event-driven programming.
Thanks Alan,
First of all, I had an infinite loop example to simulate a long
running procedure.
I have never so far written an actual infinite loop proc, I would at
least have
a break out code if I had written one.
But, nevertheless, lets attempt to go after a solution that does not
use threads.
How do you write a file to socket copy procedure that notifies me
about it's progress
every so many bytes and does not block while doing so. How about if I
want to control how fast
the copy progresses without blocking other events? Or, lets say,
theoretically, that I want
to stream a music or a video file where the user can fast forward and
go back, without
blocking and without sending the entire file over. And also, how about
a long running
procedure that doesn't block?
Thanks
Those are just theoretical questions that need generic answers.
Thanks
.
- Follow-Ups:
- Re: serving a file to a client --- background fcopy read fileevent event puts socket channel blocking nonblocking
- From: Alexandre Ferrieux
- Re: serving a file to a client --- background fcopy read fileevent event puts socket channel blocking nonblocking
- From: Fredderic
- Re: serving a file to a client --- background fcopy read fileevent event puts socket channel blocking nonblocking
- From: Alan Anderson
- Re: serving a file to a client --- background fcopy read fileevent event puts socket channel blocking nonblocking
- References:
- serving a file to a client --- background fcopy read fileevent event puts socket channel blocking nonblocking
- From: vitick
- Re: serving a file to a client --- background fcopy read fileevent event puts socket channel blocking nonblocking
- From: Bruce Hartweg
- Re: serving a file to a client --- background fcopy read fileevent event puts socket channel blocking nonblocking
- From: vitick
- Re: serving a file to a client --- background fcopy read fileevent event puts socket channel blocking nonblocking
- From: vitick
- Re: serving a file to a client --- background fcopy read fileevent event puts socket channel blocking nonblocking
- From: Alan Anderson
- serving a file to a client --- background fcopy read fileevent event puts socket channel blocking nonblocking
- Prev by Date: Re: serving a file to a client --- background fcopy read fileevent event puts socket channel blocking nonblocking
- Next by Date: Re: Autoexpect under Windows (and later Mac and Linux)
- Previous by thread: Re: serving a file to a client --- background fcopy read fileevent event puts socket channel blocking nonblocking
- Next by thread: Re: serving a file to a client --- background fcopy read fileevent event puts socket channel blocking nonblocking
- Index(es):
Relevant Pages
|