Client freezing when server is not running during connect under linux

Hello,

I am using a SuperTCPChannel for a client compiled for linux under delphi. I set the following timeouts for the channel itself:

Channel.ConnectTimeout := 2000;
Channel.ConnectionWaitTimeout := 2000;
Channel.RequestTimeout := 2000;
Channel.AckWaitTimeout := 2000;

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.

Any ideas?

Regards
Stephan

Hi,

What exactly SuperTCPChannel are you using ?
We have 4 SuperTCPChannels in Delphi.

Can you try another one channel, for example replace TROSuperTcpChannel with TROIndySuperTCPChannel

Will it work as expected?

Hi Evgeny,

I tried both (TROSuperTcpChannel and TROIndySuperTCPChannel). Same behaviour.

Regards
Stephan

Hi,

Is server-side hosted on Windows or Linux platform?
How about default timeout values? will it work?

Hi EvgenyK,

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.

Regards
Stephan

Another observation: The issue does not occur, when I try to connect to an ip address not being in use.

The issues does occur when the ip address is assigned to a windows computer not running the server application.

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.

Hi,

so client (linux) can connect and work as expected with server (Windows) when Windows firewall is disabled. is it correct?

I mean, issue in Windows Firewall?

Hi EvgenyK,

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.

Hi,

You can use AsyncEx methods. in this case, all calls are performed in background thread and your client won’t be frozen.

Hi EvgenyK,

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.

Hi,

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.

Hi EvgenyK,

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.