You are not logged in.
Pages: 1
Hi!
I'm new to the MoRMot framework and I have a question to ask.
After I've started the server and I connect with the client(localhost), there seems to be a 1 second deadlock everytime a request is sent to the server(localhost) and I'm not entirely sure why.
I've debugged it using Delphi XE7 32bit and the lock happens in SynCrtSock.pas
procedure TWinHTTP.InternalSendRequest(const aData: SockString);
...
...
WinHttpAPI.SendRequest(fRequest,nil,0,pointer(aData),L,L,0)
...
...
end;
It feels like it's spinning up a new thread everytime or something, I've noticed this in other examples as well. Also tested on another computer (Win8-64).
Not knowing much about the framework as I just started learning it, I am fairly certain I'm just missing something here so would be grateful if somebody could point it out.
Cheers
Offline
No, there is no thread created, the WinHttp API just always waits a little internally, probably for security reasons.
If you use the plain socket client, you won't have this delay.
This is a Windows WinHttp "feature", I'm afraid...
Offline
Thanks, that solves it, I need to do some more reading on this.
Offline
this thread was linked in https://synopse.info/forum/viewtopic.php?id=4899 and I realized I forgot to update on what happened.
In short, the problem had to do with server failing to register url because I didn't run the server executable as administrator at least once (as recommended by documentation if using useHttpApiRegisteringURI). If you haven't registered URL you won't really get any errors unless you are running the server sample under debugger, instead it auto drops to using sockets. Somehow this causes delays when using the client sample, if the server url is registered properly then everything works great as expected.
Offline
Pages: 1