Re: serving a file to a client --- background fcopy read fileevent event puts socket channel blocking nonblocking



In article
<7a3ef3f4-8af1-4078-a75d-b0fbf16add80@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
vitick@xxxxxxxxx wrote:

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.

Start with the [fcopy] manual page, and look at how the second example
works. The -command option along with a -size value does exactly what
you are asking. You can modify the CopyMore procedure to do additional
actions, such as setting the value of a progress bar widget.

How about if I
want to control how fast
the copy progresses without blocking other events?

Change CopyMore to do smaller or larger chunks based on a control
widget's value, and/or to introduce a delay before rescheduling itself
to call the [fcopy] again.
.



Relevant Pages