#1 2021-08-08 19:29:31

rareMax
Member
From: Ukraine
Registered: 2021-06-06
Posts: 3

TCP Server in mORMot2

Hello. I try use TAsyncServer. I'm start server. Client connected to server, but how to send message (Hello word) from server to client?

draft: https://gist.github.com/ms301/5d3fe01b6 … 05a0e7de07

Last edited by rareMax (2021-08-09 18:51:35)

Offline

#2 2021-08-09 07:27:38

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,346
Website

Re: TCP Server in mORMot2

Hello and welcome for your first post,
Please follow the forum rules and don't post code here directly in the forums: use a separated gist instead.

The TAsyncServer needs to override some methods to handle the incoming/outgoing messages.
You may check how TRtspOverHttpServer is implemented in the mormot.net.rtsphttp.pas unit.
It uses two TPostConnection/TRtspConnection classes, in which OnRead() redirect to the other end, using Sender.Write().

Offline

#3 2021-08-10 18:25:00

rareMax
Member
From: Ukraine
Registered: 2021-06-06
Posts: 3

Re: TCP Server in mORMot2

Thanks for the answer. The server successfully sent a hello world to the client.
(gist in first post has been updated)

Offline

Board footer

Powered by FluxBB