You are not logged in.
Pages: 1
Hi @ab,
I have converted Project31ChatClient to "pure" mormot2.
Everything works correctly, but when disconnecting the client it generates "IInvokable has no GUID" error on the server, and as a consequence a memory leak.
log
mormot.rest.memserver.TRestServerFullMemory(015ed360) TRestServerRoutingRest.Error: { "errorCode":406, "error": {"EInterfaceFactory": { "ClassName": "EInterfaceFactory", "Address": "tinterfacefactory.create", "Message": "TInterfaceFactoryRtti.Create: IInvokable has no GUID" }} }
mormot.core.interfaces, 3734
...
if IsNullGuid(fInterfaceIID) then
raise EInterfaceFactory.CreateUtf8(
'%.Create: % has no GUID', [self, aInterface^.RawName]); <<--- here
Lazarus + FPC Win 32
Cross compiled to Win x64
Last edited by macfly (2021-09-01 16:28:20)
Offline
Small side note: under Lazarus, you would rather install the mormot2 package, then include it as dependency to your project.
So you won't need to setup the mORMot folders, which are relative to your own setup/computer.
I have just fixed the "IInvokable" problem.
Check https://github.com/synopse/mORMot2/comm … 532bcb0ae1
But it sounds like if our WebSockets support is a bit unstable on mORMot 2.
So any feedback is welcome.
I will need to add WebSockets support to our newly introducing async HTTP sockets server. It will allow any number of concurrent websockets clients, whereas the current WS server uses on thread per client which exhausts the system resources quickly.
So perhaps the debug phase would take place with this new WS server.
Online
Thank you ab,
Issue resolved in this latest update.
These are my first tests with websockets and mormot, any observation I can tell.
Good news about the asynchronous http server.
Hadn't noticed this new feature, I'll see.
Good tip about packages. It is already installed to run the tests.
I will use it from now.
Offline
Yes, I'm using it from now on.
Offline
I'm playing with Websockets and when using a rawbytestring parameter the server freezes at some point to process the request.
IRunService = interface(IServiceWithCallbackReleased)
...
procedure CacheContentInServer(const ACacheName: String; AContent: RawByteString; out ASaved: Boolean; out AError: String);
end;
I didn't get many clues in the debug but it caused a memory leak:
https://gist.github.com/devaex/d6b7ad7c … 9fd811e8af
The error disappeared when changing the parameter to RawUtf8.
For my case, the correct type would be RawUft8 because the content are text.
But I believe this will be a problem for anyone who needs to send binary content with RawbyteString.
mormot2 + Lazarus + FPC Win32 + Cross to Win 64.
Offline
Forget about it, my mistake.
Analyzing better the memory leak I saw that could be due to logs being generated for the console.
The logs are sending the entire content of the request to the console.
Fixed reducing logs level and/or disabling the output to console.
Offline
Hi ab, after this last update I'm getting a 404 timeout on the server when calling any callback method.
It can be verified in the same example:
https://github.com/devaex/ClientServerWebSocketSample
EInterfaceFactory {Message:"TInterfacedObjectFakeServer.FakeCall(IChatCallback.NotifyBlaBla) failed: 'TWebSocketServerRest.Callback(2) received status=404 from root/ChatCallback.NotifyBlaBla/1'"}
Both Server and Client compiled with lastet version.
Complete log:
https://gist.github.com/devaex/b06194e8 … ab28325767
Offline
Really everything is ok.
The Settings property was removed in the update, and for inattention, for the project to compile I commented the entire line including WebSocketsEnable.
Sorry for the inconvenience
// HttpServer.WebSocketsEnable(Server,PROJECTEST_TRANSMISSION_KEY).Settings.SetFullLog;
Offline
But it sounds like if our WebSockets support is a bit unstable on mORMot 2.
So any feedback is welcome.
I'm getting random 404 on the client side.
Same machine, and right after opening server and client, so it's not related to downtime.
It occurs much more frequently on linux than on Windows. On Windows it is rare, on linux it is constant.
TInterfacedObjectFakeClient.FakeCall(IClientService.ListDetails) failed: 'URI root/ClientService.ListDetails[] returned status 'Not Found' (404 - Network problem or request timeout)'
Note: I'm registering 2 services on the server.
And I'm pretty sure this only happens when I register more than one service.
Because it hasn't happened yet when I removed one of the services.
But I still need to run more tests to confirm.
Update: I'm not sure I can actually register more than one service on the same server. Maybe this really isn't supported.
Resolved by creating a server for each service.
Last edited by macfly (2021-09-15 12:50:07)
Offline
It seems that after the last updates the server doesn't accept new connections when the client disconnects.
Reproducible through the example project.
https://github.com/devaex/ClientServerWebSocketSample
1 - Connect to server with 1 client only
2 - Disconnect
3 - The server no longer accepts new connections and freezes.
Update: This is caused by the -gh option (report memory leaks) in Server.
The error went away after disabling. And it only occurs on Linux.
Last edited by macfly (2021-09-15 12:52:29)
Offline
Updates to the posts above, both resolved
Offline
You should be able to register several services per server, for sure.
Okay, ab.
Strangely, in my real application I experience freezes and slowdowns that I can't reproduce in the WebSocketChat sample.
The difference is that in the application the server is running in a daemon.
I'm going to modify the WebSocketChat to do more testing.
Offline
Pages: 1