#1 2025-11-25 14:15:48

dcoun
Member
From: Crete, Greece
Registered: 2020-02-18
Posts: 485

ENetSock exceptions with THttpClientSocket.SockInReadLn Closed

I am getting errors like the following when a THttpClientSocket has probably lost its connection due to timeout, because THttpClientSocket instance was not in use for a period of time.
It does not seem to cause any harm, but is it possible to check the state before the request in order not to have this exception?

Exception: 20251125 11271351  * EXC   ENetSock {LastError:"nrClosed",Message:"THttpClientSocket.SockInReadLn [#5 Closed]"} [pool6-TepresSlave] at ee8535 mormot.net.sock.pas TCrtSocket.DoRaise (5765)   mormot.net.client.pas THttpClientSocket.RequestInternal (3310) mormot.core.text.pas VarRecToTempUtf8 (9375) mormot.net.ws.core.pas FrameInit (1486) mormot.core.buffers.pas AppendRawUtf8ToBuffer (9535) mormot.core.base.pas AppendShort (5376) mormot.core.base.pas FastSetString (5160) mormot.net.client.pas THttpClientSocket.Request (3428) System.pas @GetMem (4971) mormot.core.base.pas FastSetString (5160) System.pas @GetMem (4971) mormot.core.buffers.pas FromVarString (3497) System.pas @FreeMem (5019) System.pas @LStrClr (26350) System.pas @FinalizeRecord (33306) ephttp.pas Tephttp.httpGet (547) System.pas @ReallocMem (5093) ephttp.pas Tephttp.dohttp (669) ephttp.pas Tephttp.dohttp (689) slave.terminology.pas TTerminologySlave.GetTermCodesysEntities (169) slave.terminology.pas TTerminologySlave.Time2Run (95) rest.services.pas TepresSlavePool.Task (291) mormot.core.log.pas _SetThreadName (5429) mormot.core.log.pas _SetThreadName (5429) mormot.core.threads.pas TSynThreadPoolWorkThread.DoTask (3898) mormot.core.threads.pas TSynThreadPoolWorkThread.Execute (3930)  {6 4.26 2.92 5.3GB/7.7GB 66581b01}

Delphi 12.3 win64

Last edited by dcoun (2025-11-25 14:16:20)

Offline

#2 2025-11-25 14:49:40

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 15,305
Website

Re: ENetSock exceptions with THttpClientSocket.SockInReadLn Closed

I remember having fixed something related to this a few days ago.

Please try with the latest trunk.

Offline

#3 2025-11-25 14:56:34

dcoun
Member
From: Crete, Greece
Registered: 2020-02-18
Posts: 485

Re: ENetSock exceptions with THttpClientSocket.SockInReadLn Closed

I have the last update from github before 2 hours and I just had:

Exception: 20251125 14551607  - EXC   ENetSock {LastError:"nrClosed",Message:"THttpClientSocket.SockInReadLn [#5 Closed]"} [pool8-TepresSlave] at 9485d5 mormot.net.sock.pas TCrtSocket.DoRaise (5765)   mormot.net.client.pas THttpClientSocket.RequestInternal (3352) mormot.core.base.pas FastSetString (5160) mormot.net.client.pas THttpClientSocket.Request (3470) ephttp.pas Tephttp.httpGet (547) System.pas @ReallocMem (5093) ephttp.pas Tephttp.dohttp (669) ephttp.pas Tephttp.dohttp (689) slave.terminology.pas TTerminologySlave.GetTermCodesysEntities (169) slave.terminology.pas TTerminologySlave.Time2Run (95) rest.services.pas TepresSlavePool.Task (291) mormot.core.log.pas _SetThreadName (5429) mormot.core.log.pas _SetThreadName (5429) mormot.core.threads.pas TSynThreadPoolWorkThread.DoTask (3898) mormot.core.threads.pas TSynThreadPoolWorkThread.Execute (3930)  {12 65535.28 0.42 13 18.2GB/31.6GB 65f41b01}

Offline

#4 2025-11-25 21:41:29

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 15,305
Website

Re: ENetSock exceptions with THttpClientSocket.SockInReadLn Closed

Yes, there is an exception logged, but the request is sent as expected, right?

Offline

#5 2025-11-25 21:43:01

dcoun
Member
From: Crete, Greece
Registered: 2020-02-18
Posts: 485

Re: ENetSock exceptions with THttpClientSocket.SockInReadLn Closed

correct

Offline

#6 2025-11-25 21:43:45

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 15,305
Website

Re: ENetSock exceptions with THttpClientSocket.SockInReadLn Closed

So it is as expected.

Offline

#7 2025-11-25 21:49:14

dcoun
Member
From: Crete, Greece
Registered: 2020-02-18
Posts: 485

Re: ENetSock exceptions with THttpClientSocket.SockInReadLn Closed

Is it possible to stop logging this exception?

Offline

#8 2025-11-26 15:30:01

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 15,305
Website

Re: ENetSock exceptions with THttpClientSocket.SockInReadLn Closed

Offline

#9 2025-11-27 06:30:10

dcoun
Member
From: Crete, Greece
Registered: 2020-02-18
Posts: 485

Re: ENetSock exceptions with THttpClientSocket.SockInReadLn Closed

Thank you a lot ab

Offline

Board footer

Powered by FluxBB