> Reading "CHANGES" I see an important missing feature: server timeout
> while sending an email to the client.
> 
> Check list archives around 14/Jan/2002 :-)

To overcome the potential performance problem of to setup an alarm for
every written data chunk, a possibility would be:

- Setup the alarm for, let's say, 5 minutes.

- Set a flag to 0

- For every chunk written (or syscall interrupted), check the flag. If
the flag is 2, the connection has timeout-ed and must be shutdown. If
the flag is 3, setup a new alarm and set the flag to 0.

- Set the flag to 1.

- In the alarm signal routine, if the flag is 1, set the flag to 3. If
the flag is 0, set the flag to 2.

So your overhead will go every 5 minutes, instead for every chunk.

The legend would be:

0 -> timer running, no outgoing traffic.
1 -> timer running, outgoing traffic in progress.
2 -> timer expired, without traffic. The connection must be shutdown.
3 -> timer expired, outgoing traffic fine. Setup a new timer.

-- 
Jesus Cea Avion                         _/_/      _/_/_/        _/_/_/
[EMAIL PROTECTED] http://www.argo.es/~jcea/ _/_/    _/_/  _/_/    _/_/  _/_/
                                      _/_/    _/_/          _/_/_/_/_/
PGP Key Available at KeyServ   _/_/  _/_/    _/_/          _/_/  _/_/
"Things are not so easy"      _/_/  _/_/    _/_/  _/_/    _/_/  _/_/
"My name is Dump, Core Dump"   _/_/_/        _/_/_/      _/_/  _/_/
"El amor es poner tu felicidad en la felicidad de otro" - Leibniz

Reply via email to