Md Lazreg wrote:

> It is possible that the previous Windows behavior is correct but that
> is not the behavior I want.

I think you are incorrect about that.

> I want the same behavior as UNIX which in my opinion is what my clients
> would want. My clients can connect to a set of servers in a raw, if one
> is not available for whatever reason I want them to move to the next one
> instead of having to wait the whole timeout before trying the next server.

I agree. But that's not what your code does now. What your code does is
stops trying the first server. What you want it to do is start trying the
second server.

Here's probably what you want:

1) Start trying to connect to the first server.

2) Wait a short amount of time to see if we have a connection.

3) If we have a connection, we are done. We succeed.

4) If we don't have a connection, add another attempt to another server, if
possible.

5) If all connection possibilities have failed, stop. We fail.

6) Go to step 2.

Note that this does not require the change you made, which allows you to
detect soft failures. If you get a soft failure, there is no reason to abort
the attempt -- it still might succeed. And why would you want to wait 60
seconds or so if a server is not responding at all if you have another
server you could try?

> Thanks for your help.

You're welcome. I'm glad you got it working the way you think you want it.
But I don't think it's working the way you should want it. There is no rush
to abort a connection attempt that might ultimately succeed, no matter how
unlikely. Just don't wait for it -- keep going, and if it fails, no loss. If
it succeeds later, you still win.

DS


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to