RTC Forums

Subscription => Support => Topic started by: sunstone on October 25, 2010, 03:49:14 AM



Title: Why the demo of rtc_messenger has two login functions?
Post by: sunstone on October 25, 2010, 03:49:14 AM
Dear,

The demo of rtc_messenger has login and login2. Why?
Could you explain the function of login2 ?

Thanks,

Sunstone


Title: Re: Why the demo of rtc_messenger has two login functions?
Post by: D.Tkalcec (RTC) on October 25, 2010, 07:49:40 AM
Each client uses 2 physical connections and the 2nd login function is for the 2nd connection (the one periodically polling the data from the server).

Best Regards,
Danijel Tkalcec


Title: Re: Why the demo of rtc_messenger has two login functions?
Post by: sunstone on October 25, 2010, 09:27:09 AM
Why not use only one login function (user login and get data)?
Can the Login and Login2 be combined?


Title: Re: Why the demo of rtc_messenger has two login functions?
Post by: D.Tkalcec (RTC) on October 25, 2010, 06:50:02 PM
You should NOT look at RTC Demos as "the only" way to implement something, neither should you see the Demos as "the best solution" to a particular problem. These are ONLY example projects which demonstrate one *possible* way of using the RTC SDK.

In other words, you can implement this and a lot of other things in a lot of different ways, if you spend enough time with the code and know how to use the RTC SDK.

Best Regards,
Danijel Tkalcec


Title: Re: Why the demo of rtc_messenger has two login functions?
Post by: sunstone on October 26, 2010, 02:11:38 AM
 :(  Could I use one TRtcClientModule for user logon and getting datas?

How do you think to use two TRtcClientModule? More fast or nonblocking?


Title: Re: Why the demo of rtc_messenger has two login functions?
Post by: D.Tkalcec (RTC) on October 26, 2010, 02:21:02 AM
If one connection is used with TRtcDelayedCalls on the Server side, you will need a 2nd connection to be able to send requests to the Server while waiting for data on the 1st connection. This is why the RTC Messenger Client uses 2 connections and 2 TRtcClientModule components.

You *could* change the RTC Messenger Server implementation to NOT use TRtcDelayedCalls on the Server and then use only 1 TRtcClientModule and 1 TRtcHttpClient component on each Client, but then you would need to send polling requests using a timer and not immediately after receiving each request (as it is done now) and Clients would NOT be notified about received messages immediately, but only in the intervals you specify in the timer used to send polling requests.

Best Regards,
Danijel Tkalcec


Title: Re: Why the demo of rtc_messenger has two login functions?
Post by: sunstone on October 26, 2010, 03:39:24 AM
 :)Now I understand the reason. Thanks for your Patiently explanation.

Hope RTC getting better!

Best regards,
Sunstone