You are not logged in.
Pages: 1
I frequently have this error, only on debug (Delphi 12).
Error:
Project xpto.exe raised exception class ENetSock with message 'THttpClientSocket.SockSendFlush(127.0.0.1) len=292 [Fatal Error - #6]'
It doesn't happen every time and not in the same place (in the code)... It appears to be harmless.
Offline
No, the server is a separate program altogether.
I can add the Call Stack if that helps...
Offline
Perhaps https://github.com/synopse/mORMot2/commit/598c16d2 could help to include the low-level Win32 API error code.
Offline
Hello,
Using the commit above I get:
If I open and close the app rapidly I get no error... Seems to be time dependent, but I could be wong.
Last edited by imperyal (2024-04-10 10:59:06)
Offline
When my app is not doing nothing I still get those errors, it could confirm this time dependent theory.
Erro and Call Stack:
Offline
OK now I understand.
sys=10054 means WSAECONNRESET.
My guess is that the connection is just closed by the server after a while, and you have the background thread which "_ping_" the server on this closed connection.
It raises an exception, which is caught as expected, then a new client connection is created, and the "_ping_" succeeds.
On production, you don't see this exception, because it is caught/intercepted, then a new connection is made.
In debug mode, you see this exception, but the client continues to work as expected.
The server-side timeout is set by TAuthGroup.SessionTimeout. Usually it is 60 minutes for a non-admin user, so the "_ping_" is done every 30 minutes (half the session timeout value).
If you don't like this "hearbeat / ping" feature, just set TRestClientUri.SessionHeartbeatSeconds := 0.
Also ensure you did not make a too small value in the TAuthGroup.SessionTimeout of the user's group.
Offline
Yes, on production there is no error.
Our TAuthGroup.SessionTimeout is 60.
But I get those errors after way less the 30 minutes of inactivity...
In this next case, only 7 minutes have passed:
I think there is something else going on...
Last edited by imperyal (2024-04-10 17:12:19)
Offline
I'm using the TRestHttpServer class to expose a TRestServerDB server (more precisely, a class that extends the TRestServerDB with some server methods, and some helper methods as well.. nothing too fancy).
Offline
TRestHttpServer with which kind of HTTP server? async? socket?
Perhaps https://github.com/synopse/mORMot2/commit/e8293e77 would help.
It should detect any broken connection before sending the request, then re-create the connection, and therefore avoid any exception.
Offline
I'm just creating it like that:
MSS_ServerDB.DB.Synchronous := smOff;
MSS_ServerDB.DB.LockingMode := lmExclusive;
TRestHttpServer.Create(K_conn_port_cloud, [MSS_ServerDB], '+', useHttpApiRegisteringURI, 32, secSSL, '', '')
If that's not the best way to create the server please advise...
Last edited by imperyal (2024-04-11 10:51:07)
Offline
So you are using the http.sys Windows server (useHttpApiRegisteringURI).
I don't know why it reset the connection after 7 minutes. My guess is that it should not. But it could do whatever it wants, and it is a Microsoft-owned system blackbox.
Anyway, please try my latest commit above: it should avoid any exception on the client side, which should gracefully reconnect in such cases.
Offline
I will try that commit and let you know.
It is a small annoying thing (it disrupts the debug a little) but it does not affect anything as far as I'm aware.
Side note: on mORMot 1 that didn't happen. Same server configuration (useHttpApiRegisteringURI).
Offline
The problem is solved, no more errors while debugging.
Is it safe to use this commit (e8293e7) in production?
Thank you once again Arnaud
Offline
I have fixed some client-related issues this morning.
You should perhaps better use
https://github.com/synopse/mORMot2/commit/509c8565
Offline
Ok, thank you!
Offline
Pages: 1