RTC Forums
November 24, 2024, 07:46:15 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: some help on C/S design  (Read 8468 times)
GeorgeK
Newbie
*
Posts: 7


« on: September 21, 2010, 10:31:46 AM »

I have an internet cafe software that consists of two parts:

1) One software installed on Reception desk (for employee)

2) One software installed on every Workstation computer (customers)

The Reception software has a grid list of all clients with connection status

Workstation-1         Connected
Workstation-2         Closed
Workstation-3         Closed
Workstation-4         Connected

The Reception software execute remote functions on workstations such as
"RebootPC", "GetScreenResolution", "LockComputer", "ChangeVolume" etc...

Till now things are clear and I can create an RTC Server on Reception software and RTC Client on Workstastion computers.

The issue I have is that the Workstation computer also needs to execute remote functions on Reception desk, such as
"TotalChargePrice", "TotalTime", "TimeLeft" etc...

Can you please help me decide how to design this system?
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #1 on: September 21, 2010, 12:05:55 PM »

I am afraid I do not understand your question.

Please remove your application-specific terms and use the terms "ClientA", "ClientB", "Client..." for Apps which are using client-side components (making outgoing connections and sending requests) and "Server1", "Server2", "Server..." for Apps which are using Server-side components (accepting incoming connections and executing received requests) then explain which side needs to call what where to make it clear for everyone what you want to do, without the need for someone to understand your application-specific business logic.

Best Regards,
Danijel Tkalcec
Logged
GeorgeK
Newbie
*
Posts: 7


« Reply #2 on: September 21, 2010, 12:27:55 PM »

ok let me make it more clear.

I have a reception software with RtcServerModule and workstations software with RtcClientModule

many, lets say 50, workstastion computers (with RtcClientModule) connect to the 1 and only reception software (RtcServerModule)

It is easy for workstation computer to execute remotely functions on server but what about the other way?
How RtcServerModule can execute remote functions on client? As I can see the function Prepare is not available.
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #3 on: September 21, 2010, 12:48:17 PM »

This is because the Server is per definition NOT supposed to have control over Clients.

If you want to allow the Server to execute remote functions on your Clients, each Client should make remote calls to the Server to ask the Server if there is something the Server wants to have executed on the Client. In the remote function implementation on the Server, you would prepare TRtcFunctionInfo objects as a Result (using the "newFunction" method, similar to how the Client does it when calling functions on the Server), which would be sent to the Client, where you can use the same TRtcFunctionGroup (linked to TRtcClientModule) and TRtcFunction components (linked to TRtcFunctionGroup) to have these functions executed automatically when they arrive from the Server.

You should also use a separate TRtcHttpClient component on the Client for making these "polling" calls to the Server and use RTC Delayed Calls on the Server to minimize traffic by placing a request from the Client "to sleep" on the Server if there is no data ready to be sent back yet, waking the call up when there is data available.

There are several topics on these Forums explaining the use of RTC Delayed Calls and "making reverse calls", which you should be able to find easily by using the "Search" feature of this Forum.

PS. If your Server has to call remote functions on your Clients, you might have to reconsider your application design to make it more Client/Server-like. In a typical Client/Server scenario, the Server never calls functions on the Client without the Client explicitly asking for it.

Best Regards,
Danijel Tkalcec
Logged
lionheart
Newbie
*
Posts: 18


« Reply #4 on: March 24, 2012, 01:08:26 PM »

I have an old cafe system written in Delphi using IndyTCPServer. Frankly i have been thinking of changing it to use TRtcTCPServer because i like the event-driven based and flexibility of RTC. I have not started anything yet and did a search here and found this topic. I have used postdelaycall in my other application, however for a cafe system it has all the connected client represented in listview (or any collection controls) to show the state of the client whether it is connected, running a gaming/surfing session, poweroff etc. In other words doesn't the server has to be stateful ? therefore is TRtcHttpServer suitable for the requirement ?

Below is the basic flow of a cafe system
1. Client Application contacts the server application and connects, giving its name (computername or any unique ID).
2. Once the connection is successful then all communication from here on in will be initiated by the server application. For example, to tell a client to grant access for N minutes session, to poweroff a client, to logoff a session etc.

It will be great to hear from the gurus to share ideas, if it is good to use TRtcHttpServer then it will great then i can change the old cafe codes to use RtcHTTPServer which i like very much Smiley


Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #5 on: March 24, 2012, 06:35:26 PM »

Yes. Nexus Portal Gateway and RTC Messenger are examples where delayed calls are used to achiee the same goal (Server being in control of when to reply to the Client).

There is no requirement for the Server to be stateful, though. In order to use delayed calls, you only need to work with RTC remote functions and have the Client use one TRtcHttpClient component for "polling" the Server periodically, or immediately after each response arrives.

To scale with potentially increasing load (if the number of your Clients exceed capabilities of a single Server), you can use a Load Balancer connecting to multiple Servers.

Best Regards,
Danijel Tkalcec
Logged
Kevin Powick
RTC Expired
*
Posts: 87


« Reply #6 on: March 28, 2012, 05:36:37 AM »

I think the problem described (in terms of a C/S model) can easily be handled by RTC components doing as Danijel suggests -- Just have the clients poll the server at regular intervals with status information and requests for action.  Don't even bother will callbacks/delayed calls.  The load of 50 clients is not going to be any great stress on the server.  Such a set-up is the easiest to understand, configure, and achieve.

Having said that, the more "correct" design is probably better defined by a communication model other than C/S.  Examples would be Peer-to-Peer (P2P) or Message Oriented Middleware (MoM), aka message queueing.  While you could probably use RTC components as the foundation for creating each of those models, it would be a lot of work.  No disrespect to Danijel or the RTC SDK, but if one really wanted to use P2P or MoM, they would likely be better served by considering other tools and components expressly designed for such purposes.

--KP
Logged

Linux is only free if your time is worthless
lionheart
Newbie
*
Posts: 18


« Reply #7 on: March 30, 2012, 03:55:11 AM »

Thanks Danijel and Kevin as usual Smiley.

Kevin,
I think i will use the postdelayedcall for converting the cafe system, postdelayedcall is faster in response time because it will wakeup the call n response to the client immediately whenever there's data, and in normal ciscumstances it will act like a timer periodically asking for data availability. On using MoM, i have habari (RabbitMQ), just that i wish to use my own server Smiley, and also my humble opinion is since most of the communication is between the server and client, i think C/S model will be just fine. 
Logged
lionheart
Newbie
*
Posts: 18


« Reply #8 on: April 05, 2012, 12:33:03 AM »

Danijel, Kevin,
Just an update. Thanks for your valuable advise, I ended up using RabbitMQ to control the messaging with workstation nodes and a manager node. The manager node also has a rtcHttpClient to connect to a NT service rtcHttpSrv mostly for remote functions to update database tables. Seems both working in harmony and good, Do you have any comment on the setup?
Logged
Kevin Powick
RTC Expired
*
Posts: 87


« Reply #9 on: April 05, 2012, 02:02:49 AM »

Sounds like an interesting hybrid approach.  I've not used RabbitMQ, but I understand it.  I assume the separation of the manager node and the RTC HTTP service was to give your system both logical and physical deployment flexibility, and perhaps address security?

Logged

Linux is only free if your time is worthless
lionheart
Newbie
*
Posts: 18


« Reply #10 on: April 05, 2012, 06:02:06 AM »

Quote
I assume the separation of the manager node and the RTC HTTP service was to give your system both logical and physical deployment flexibility, and perhaps address security
yup, it is for the customer to b able to choose if the rtcserver which controls the financial part to their corp intranet or internet. For internet i am looking forward to own streamsec SSL/TLS, though my prefer choice is Eldos Secure BlackBox
Logged
zsleo
RTC Expired
*
Posts: 80


« Reply #11 on: May 23, 2012, 04:56:03 AM »

Been a long time since I have been looking at this user group but...

I use Eldos Secure BlackBox in a number of my RTC applications but not for SSL/TLS- I am pretty sure that the is a SBB plugin that is compatible with RTC.

Also, I have used (some time ago now) the Eldos Message Connect components to do exactly what you looking to do with peer-to-peer control system.

I do understand that the RTC architecture is C/S and P2P but I do wish there was a RTC P2P equivalent.

One other approach, if the IP / DNS of then customer is fixed, is to implements an RTC Server and RTC Client at both ends. During the log in or message process, or DB control the IP / DNS of your customer site and use that to "contact" the customer's site. Messy? Yes!

Regards

Zane
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.03 seconds with 17 queries.