You are not logged in.
Hi, (Windows 10 pro 64bit, Sydney 10.4.2)
TSQLHttpClientWebsockets.Create(Host,Port,TSQLModel.Create([],ROOT_NAME),
false,'','',
SendTimeout,ReceiveTimeout,ConnectTimeout);
ConnectTimeout takes very long (over 40 seconds) in case of non existent IP / service, although we set it to 3000 miliseconds.
Thank you,
Vojko Cendak
Offline
The properties are set through SetInt32Option
// open client connection
if ConnectTimeout>0 then begin
SetInt32Option(result,SO_RCVTIMEO,ConnectTimeout); <== ConnectTimeout = 3000
SetInt32Option(result,SO_SNDTIMEO,ConnectTimeout); <== ConnectTimeout = 3000
end;
if Connect(result,sin)<>0 then begin <== waits around 20 - 30 secs
CloseSocket(result);
result := -1;
end;
Offline
It sounds like if connection timeout is not set by regular receive/send timeout options.
It is set at the system level, sadly.
So we will now try to use non-blocking mode for Connect() then call Select/Poll.
I have just added it to mORMot 2.
Online
Is it possible to add to mormot too ?
I'm not shure if we can migrate to mormot2 yet ...
Offline
thank you,
is there any other way ?
because we have lots of situations where ridiculously long timeouts stuck the app,
not gui, but termination of threads, restart of threads, ... getting user to see what is happening.
I don't know how others deal with situations when network breaks (which is normal situation), then you retry until it reestablishes the connection.
thank you
Last edited by VojkoCendak (2021-10-08 13:17:11)
Offline