You are not logged in.
Pages: 1
1.
type
IQueues = interface(IInvokable)
['{9857C187-68A2-4F22-823C-75B75F28B45A}']
function GetQueues(out response: TQueuesCollection): TResponse;
end;
2.
with Server.ServiceDefine(TQueues,[IQueues]) do
begin
SetOptions([], [optExecInMainThread]).ByPassAuthentication := true;
end;
3. put button1 in the same application where the interface is started -> TWinHTTP.Get('http://localhost:2080/api/Queues.WorkingHours'); -> application freezes until http request timeouts (why timeouts?)
When I use used component from indy: the idHttp.Get ( ) everything works fine or when I change the interface execution to own thread (removed optExecInMainThread)
Any ideas?
Offline
It is as expected.
optExecInMainThread will let the Server thread call Synchronize() to run the method in the main thread.
But at the same time, the main thread is blocked by the TWinHTTP.Get process, which doesn't call Application.ProcessMessages so Synchronize() is blocked.
As such, the server doesn't answer within the timeout period, and an error is reported.
Offline
Pages: 1