#1 Re: mORMot 2 » WebSocketsUpgrade with RemoteLogging caused ESynLogException » 2023-12-14 08:30:05

Hi Thomas,

   Thanks for the promptly reply.

I did the more testing and noticed my code is working fine when not used WebSocketsEnable() function.

I activated WebSocketsEnable() and noticed there will have logs in below:

 EXC   ENetSock {LastError:"nrFatalError",Message:"THttpClientSocket.SockSendFlush(localhost) len=539 [Fatal Error - #6]"} [TRemoteLog LogService] at 637c26
 EXC   ESynLogException {Message:"Missing TSynLog.DisableRotemoteLog(true)"} [R1:root] at 59826e
 trace mormot.net.ws.async.TWebSocketAsyncProcess(025bd5c0) ProcessStop: callbacks
 debug mormot.net.ws.async.TWebSocketAsyncProcess(025bd5c0) ProcessStop {"TWebSocketProtocolBinary(025a7530)":{Name:"synopsebin",URI:"root",RemoteIP:"172.17.112.1",UpgradeUri:"root",Encrypted:true,FramesInCount:1,FramesInBytes:33,Options:["pboSynLzCompress"],FramesInBytesSocket:66,FramesInCompression:-100,FramesOutCompression:100}}
 trace mormot.net.ws.async.TWebSocketAsyncProcess(025bd5c0) SendFrame 172.17.112.1 * focConnectionClose len=0
 warn  mormot.net.ws.async.TWebSocketAsyncProcess(025bd5c0) Destroy: no focConnectionClose SendFrame

 

However, this is too far for me.

Best Regards,
JienYuan

#2 mORMot 2 » WebSocketsUpgrade with RemoteLogging caused ESynLogException » 2023-12-13 09:31:56

jienyuan
Replies: 2

After I added

TRestHttpClient.CreateForRemoteLogging('localhost',TSynLog,8091) in restws_chatserver program;

  with TSynlog.Family do
    ....
  WebSocketLog := TSynLog; // verbose log of all WebSockets activity
  TRestHttpClient.CreateForRemoteLogging('localhost',TSynLog,8091);
  try
    ...
  end;

to redirect logs to Logview in rest-websockets sample.

The Client.ServerTimeStampSynchronize will hang and raised the exception in Logview.

[bold]EXC   ESynLogException {Message:"Missing TSynLog.DisableRotemoteLog(true)"} [R1:root] at 59826e  [/bold]

Have any idea? Thank you.

#3 Re: mORMot 1 » Service Record type Dynamic Array result for Delphi 7 has limitation? » 2017-07-22 14:27:15

Hi AB,

  Thanks for the reply.

I do read the thread and topic in the document.

But it noticed

If your application is developped on any older revision (e.g. Delphi 7, Delphi 2007 or Delphi 2009), you won't be able to automatically serialize records as plain JSON objects directly.

You have several paths available:

By default, the record will be serialized as binary, and encoded as Base64 text

So, I was wondering might Delphi 7 record will be serialized as binary, and encoded as Base64 text then pass to client.

Now, I see it.

Thanks again.

#4 mORMot 1 » Service Record type Dynamic Array result for Delphi 7 has limitation? » 2017-07-22 08:07:16

jienyuan
Replies: 3

I tried Record type Dynamic Array service result in Delphi 7.
However, the result lost information after 50th item in Delphi 7 but seems correct in Berlin.
Is it a limitation in mORMot 1.18 & Delphi 7 ?

The code is:

Type
   TCodeValue=packed record
       Code: string;
       Value: string;
   end;

  TCodeValueArray = array of TCodeValue;

  IServiceClient = Interface(IInvokable)
  ['{E1779C4E-C7E3-4F83-BF94-91E907774384}']
    function getLis: TCodeValueArray ;
  end;

 
  TServiceClient = class(TInjectableObjectRest,IServiceClient)
  public
    function getList: TCodeValueArray ;
  end;

 
function TServiceClient.getList: TCodeValueArray;
var
  x: integer;
begin
  SetLength(result,100);
  for x:=Low(result) to high(result)  do begin
    result[x].Code:=Format('User%0:.3d',[x]);
    result[x].Value:=Format('Name%0:.3d',[x]);
  end;
end;


test:
var
   d: TCodeValueArray;
   x: integer;
begin
   d:=c.getList;
   for x:=Low(d) to High(d) do
     writeln(d[x].code+'|'+d[x].value);
end; 
 
I only got this in Delphi 7.

  User000|Name000 (first)
  .
  .
  User049|Name049
  |
  |
  .
  .
  | (100th)

Board footer

Powered by FluxBB