You are not logged in.
Pages: 1
I work for a while with Delphi, but I'm starting recently with mORMot. I'm working on a WebSocket project. I analyzed the samples (31), especially Project31SimpleEchoServer, because I want to integrate a web application with the server. This project uses TWebSocketProtocolChat, but I did not find any example of using TWebSocketProtocolRest (I looked in google and forum). There are some practical example of the use of TWebSocketProtocolRest on server and a web client communicating with it?
Thanks!!!
Offline
TWebSocketProtocolRest is to be used with interface-based services, and a interface parameter in a method, to supply a callback.
See http://synopse.info/files/html/Synopse% … l#TITL_149
But it supports only Delphi clients by now, not pure web clients.
For pure web clients, you need to use the raw TWebSocketProtocolChat.
But, of course, it is much less powerful.
Offline
Thanks for the reply!
For web I'm using TWebSocketProtocolChat, and it's great!
Just a question, can I use TLS for secure websockets connections? I didn't find examples.
Thanks!
Offline
I am a long time RAD Delphi Programmer, so Programming in Mormot way is quite difficult for me. But i'm insist to try though.
And now I've been spending my whole night, trying to Clone the Client Server Chat sample (Project31-> implementation of TWebSocketServerRest) into Highlevel VCL environment. But i keep failing.
What i'm trying to do is to visualize all the activity (Incoming Join, Message, And Who is Leaving the room) in my server mainForm via a method pointer.
For example like below:
Type TOnReadEvent= Procedure(msg: string) of Object;
procedure TServerMainForm.OnRead();
begin
Memo1.lines.add(msg);
...
end;
Then i create a method pointer property in the service interface and also in the class implementation.
for later, i can bind it to My TServerMainForm.OnRead method. Then I produce all the message activity manually by calling those method pointer property inside Join and NotifyBlaBla of the server service class. But, The program produced Runtime Error 217, For it seems that Declaring a Method Pointer in interface is not allowed in Delphi. But i'm not sure about that.
So would you please help me, is there any beter way to do this, is there any published method or property maybe something like the one in TWebSocketProtocolChat example which is "OnIncomingFrame" property.
Thanks Sir ! Sorry For my bad english.
Offline
Pages: 1