RTC Forums

Subscription => Support => Topic started by: twinsoft on June 04, 2020, 07:11:59 PM



Title: RtcHttpClient in Listen mode
Post by: twinsoft on June 04, 2020, 07:11:59 PM
Hi, we would like to know if it is possible to set RtcHttpClient in listen mode. After successfull connection, listen to incoming messages, without sending something first. We cannot use DelayedCalls as the comunication is between 2 RtcHttpClients.

Stefanos


Title: Re: RtcHttpClient in Listen mode
Post by: D.Tkalcec (RTC) on June 04, 2020, 07:14:21 PM
There is no "listen mode" for Clients. Servers listen for incoming connections, while Clients connect to Servers. That is how TCP/IP works in general.

Best Regards,
Danijel Tkalcec


Title: Re: RtcHttpClient in Listen mode
Post by: D.Tkalcec (RTC) on June 04, 2020, 07:35:58 PM
You can use WebSockets with TRtcHttpClient and TRtcHttpServer components if you need message-based two-way communication between HTTP Clients and a HTTP Server. There are two example projects available, both can be found in the "Examples" folder, under sub-folders WebSockClient and WebSockServer.

Best Regards,
Danijel Tkalcec


Title: Re: RtcHttpClient in Listen mode
Post by: twinsoft on June 05, 2020, 08:44:13 AM
Hi, actualy we where looking at RtcMessageClient/RtcMessageServer and possibly a custom transport based on simple TCPClient. We cannot find an example or information on how to use these components and in the forum there are only a few topics on them. Can you provide detailed information on how to use them, and some demo code ?

Stefanos


Title: Re: RtcHttpClient in Listen mode
Post by: D.Tkalcec (RTC) on June 05, 2020, 12:34:10 PM
TRtcMessageClient and TRtcMessageServer are wrappers for using blocking, message-driven, stream-based third-party transports like NexusDB connection components, with higher-level RTC components. TRtcMessageClient and TRtcMessageServer components do NOT implement a communication protocol and are NOT meant to be used on-their-own, unless you plan to implement your own custom transports for use with higher-level RTC components.

If that is what you wanted (implement your own custom transports for RTC components) and you need an example, then check NexusDB transport plugins in the "LibPlugins" folder ("nxRtcClient.pas" and "nxRTCServer.pas" units), but I can NOT provide you with "detailed information" on how to implement a custom transport. That's way too low-level. Sorry.

Best Regards,
Danijel Tkalcec