You are not logged in.
Pages: 1
Hello gurus,
I have a client:
FClient := TSQLHttpClientWinHTTP.Create(FServer, FPort, Model);
How to increase timeout for the client?
I tried to make so:
FClient.WinApi.ConnectionTimeout := 120000;
as it discussed here: http://synopse.info/forum/viewtopic.php?id=1335
but it looks like WinApi has no ConnectionTimeout property.
What should I do?
Thanks a lot.
Offline
I see in SynCrtSock next code:
/// TWinHttpAPI timeout default value for DNS resolution
// - leaving to 0 will let system default value be used
HTTP_DEFAULT_RESOLVETIMEOUT = 0;
/// TWinHttpAPI timeout default value for remote connection
// - default is 60 seconds
HTTP_DEFAULT_CONNECTTIMEOUT = 60000;
/// TWinHttpAPI timeout default value for data sending
// - default is 30 seconds
// - you can override this value by setting the corresponding parameter in
// TWinHttpAPI.Create() constructor
HTTP_DEFAULT_SENDTIMEOUT = 30000;
/// TWinHttpAPI timeout default value for data receiving
// - default is 30 seconds
// - you can override this value by setting the corresponding parameter in
// TWinHttpAPI.Create() constructor
HTTP_DEFAULT_RECEIVETIMEOUT = 30000;
So please show me the way to create my own TWinHttpAPI object for my FClient.
My extreme way is to change mORMot contants but I think it is not very good idea.
Thanks.
Offline
Thanks a lot for your time.
hmmm... so what is the solution?
Last edited by alexdmatveev (2014-11-20 14:15:46)
Offline
I have increased every timeout constant to extremely big 600000 (10 min).
and now I can send big files. Works for me so.
But I hope to get from Synopse team good solution for the task.
Thanks a lot.
Offline
This happens because you increase HTTP_DEFAULT_SENDTIMEOUT for client side and HTTP_DEFAULT_RECEIVETIMEOUT for server side. This parameters is work OK. And you can increase it's also in TWinHttpAPI.Create(). No need to change consts.
Offline
ok, thanks
the main question for me now is how to make it from my code but not in SynCrtSock.pas ?
what should I write before or after the line below?
FClient := TSQLHttpClientWinHTTP.Create(FServer, FPort, Model);
Offline
Hi, I'm have the same problem with this code:
winHTTP := TWinHTTP.Create('localhost', '888', false, '', '', 60000, 70000, 130000);
try
Result := winHTTP.Post(StringToUTF8(link), StringToUTF8(data));
finally
winHTTP.Free;
end;
I think TWinHTTP.Create don't store any timeout parameters
The "winHTTP.Post" method call "THttpRequest.InternalREST" that call "self.Create(Server,Port,Https,'','')" using the default timeout parameters.
Can any one help me on this?
Thank you (sorry my english)
"
Offline
Pages: 1