#1 2017-02-01 10:09:55

rian.perassoli
Member
Registered: 2017-01-31
Posts: 4

Set SendTimeOut and ReceiveTimeout TSQLHttpClient in execution time.

Can I change the SendTimeOut and ReceiveTimeout on TSQLHttpClient.Create() in execution time?
I try make the implementation but if I set differents Timeouts the program goes into this exception of method THttpApiServer.Execute on SynCtrSock.pas:

except
  on E: Exception do
    // handle any exception raised during process: show must go on!
    if not E.InheritsFrom(EHttpApiServer) or // ensure still connected
       (EHttpApiServer(E).LastError<>HTTPAPI_ERROR_NONEXISTENTCONNECTION) then
      SendError(STATUS_SERVERERROR,E.Message,E);
end;

and E.Message have 'HttpSendHttpResponse failed: Tentativa de operação em uma conexão de rede não existente (1229)'

I don't find anything like this in the forum...

Can someone help me? What can be happening?

Thanks (sorry my english)

Offline

#2 2017-02-01 12:47:15

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Set SendTimeOut and ReceiveTimeout TSQLHttpClient in execution time.

It will depend on the actual implementation class.
TSQLHttpClient is just an alias, depending on the platform it runs on.

But there is currently no way of changing those parameters once the instance is created.

Offline

#3 2017-02-01 15:31:58

rian.perassoli
Member
Registered: 2017-01-31
Posts: 4

Re: Set SendTimeOut and ReceiveTimeout TSQLHttpClient in execution time.

I have two threads, with sendtimeout different. In this case return de exception 'HttpSendHttpResponse failed: Tentativa de operação em uma conexão de rede não existente (1229)'. Maybe I cannot work with differents timeouts in differents threads in the same time. Am I correct?

Offline

#4 2017-02-01 15:40:39

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Set SendTimeOut and ReceiveTimeout TSQLHttpClient in execution time.

As soon as each thread as its own TSQLHttpClient instance, I do not see why it should be a problem.

Offline

#5 2017-02-01 16:25:54

EMartin
Member
From: Buenos Aires - Argentina
Registered: 2013-01-09
Posts: 337

Re: Set SendTimeOut and ReceiveTimeout TSQLHttpClient in execution time.

That error is raised when the other connection has finished by timeout, at least in my case.


Esteban

Offline

#6 2017-02-01 16:54:50

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Set SendTimeOut and ReceiveTimeout TSQLHttpClient in execution time.

Weird...
I don't understand why WinHTTP may not be thread-safe?

Did you try with the Sockets client class?

Offline

#7 2017-02-01 17:23:22

rian.perassoli
Member
Registered: 2017-01-31
Posts: 4

Re: Set SendTimeOut and ReceiveTimeout TSQLHttpClient in execution time.

I tryed with TSQLHttpClient and TSQLHttpClientWinSock, and with the two I receive the same result...

Offline

#8 2017-02-03 10:54:09

rian.perassoli
Member
Registered: 2017-01-31
Posts: 4

Re: Set SendTimeOut and ReceiveTimeout TSQLHttpClient in execution time.

Well, i make more some tests, and really isn't the change of timeout the problem.

I'm continue going to study my problem and if i resolve, I post what happened.

Thanks for the replies.

Offline

Board footer

Powered by FluxBB