Then I am calling a server function resulting in an automatic connect of the client. On the first try I do get a “No connection available” error message after 2 seconds. On the second try the application just freezes for about 120 seconds before raising the “No connection available” error message.
I am not observing this kind of behaviour when I am running the client on windows.
when I remove my four timeout lines assigning the timeout values the initial timeout occurs after 10 seconds and a second one is still freezing the application for two minutse.
The server is hosted on windows. So it’s a linux client and a windows server.
The windows server is a vanilla windows server 2022 installation. The issue does not occur when I just disable the windows firewall. So it is a combination of client and server.
it’s really a vanilla windows server 2022 installation. However Port 8095 is explicitly allowed for inbound connections. I don’t know why the mentioned timeout settings are not working as expected. I would expect that I have such control over the client connection, that I can enforce a timeout even in the mentioned scenario.
Maybe it is nescessary to dig deeper into the issue and expose some additional timeout settings as well.
the calling thread might be responsive but the channel will still wait for those two minutes. Also a reconnect could happen anytime (maybe restart of the server) and therefore synchronous calls can cause the issue as well.
the idea: you can test connection to server in background thread via calling AsyncEX method. if no feedback was received in, say, 2 sec you can report to user about failure and suggest to select another server.
maybe as a temporary workaround. Still there can be scenarios where this will not help (server application is closed while client is still running) where this can cause issues.
I would prefer having a solution solving the root cause of the problem.