> I revue your patch and I notice :
>
> We could use select to determine if something happen to the
> connection, typically readfds will be set if something is to read.
> With ajp13 protocol where everything is consumed after reading the
> previous tomcat reply, select will set read when the connection is
> closed (in TCP a closed tcp session is really a message send from
> closer).
>
> But :
> - Win32 platform are not handled with the select;
This is because I haven't been able to reproduce this
on Windows 2000. I admit I didn't try very hard last
time. So I will try it again.
> - there is a check of errno which couldn't be safe in
> multi-threaded env like Apache 2.0
Any suggestions on how to do it better? The reason
I check for ECONNRESET is I want to do this only
if the error was caused by previously shut TC.
Any other recv() error should return Internal
Server Error, because they may not be recoverable.
> - if you remove your ethernet cable you may never see
> anything in select readdfs before TCP/IP stack timeout.
well, I wasn't trying to handle that condition, though.
The select() should still be harmless.
> - Why loose cpu cycle to check if the communication socket is
> available before each request to be sent. I'll be to use an
> exception mecanism, so
> - send request
> - read reply
> - if reply read fail, retry to send request,
> if it fail = ERR 500
Okay so this means, you would prefer my proposed solution #1?
That was my inclination too.
> I'll send some modification to worker later