You are not logged in.
Hello,
I am confused about which client to use in the Windows environment.
I do not need bidirectional functionality of sockets. The mORMot framework SAD 1.18 says on page 332:
As stated above, there is still a potential performance issue to use the direct TSQLHttpClientWinSock
class over a network. It has been reported on our forum, and root cause was not identified yet.
Therefore, the TSQLHttpClient class maps by default to the TSQLHttpClientWinHTTP class. This is
the recommended usage from a Delphi client application.
However, in the mORMot 2 source code the TSQLHttpClient class maps by default to the TRestHttpClientSocket and there is a note reagrding "slower and less stable" in the source code (mormot.rest.http.client.pas):
{.$define CLIENTUSEWININET}
// force HTTP/1.1 RESTful JSON default mORMot Client class to use WinHttp
// - e.g. to try Windows built-in proxy settings
// - but is slower and less stable in some context (e.g. useHttpAsync)
Please, help me to sort this out.
Sergey
Offline
The comment means that we found out that WinHttp client performance was lower than the plain socket client class.
For bidirectional, i.e. WebSockets, there is a single client class, named THttpClientWebSockets from mormot.net.ws.client.pas, which is socket-based.
So no question asked, you don't have the choice - just this class.
Note that the async server did not exist in mORMot 1, and seems to scale better than http.sys from our tests.
Up to a few hunderths clients. For thousands of concurrent clients, switch to Linux for epoll API support.
Online
Thank you for the reply!
As I mentioned, I do not need bidirectional. So, I do actually have a choice.
As far as I can understand, the recommendations have been changed and the THttpClientWebSockets is the way to go now.
Offline
strange thing, THttpClientWebSockets randomly close, and very hard to detect/debug.
both with our mormot wsserver ,or third party wsserver,
already turn on the heartbeat by :
WSClient.Settings^.HeartbeatDelay :=10000;
Last edited by keinn (2023-08-31 03:22:45)
Offline