A driver of remote client.
The Client is an abstract class representing and interacting with a remote client. It deals the network communication with the remote client and shifts Invoke message to related User and Service objects.
Extends this Client class and override the createService method, a factory method creating a child Service object. Note that, Client represents a remote client, not an user, a specific web page or service. Do not define logics about user or account information. It must be declared in the parent User class. Also, don't define processes of a specific a web page or service. Defines them in the child Service class.
Templates - Cloud Service
- Author
- Jeongho Nam http://samchon.org
Definition at line 38 of file Client.hpp.
virtual void samchon::templates::service::Client::replyData |
( |
std::shared_ptr< protocol::Invoke > |
invoke | ) |
|
|
inlinevirtual |
Handle a replied Invoke message.
The default Client.replyData() shifts chain to its parent User and belonged Service objects, by calling the the User.replyData() and Service.replyData() methods.
Note that, Client represents a remote client, not an user, a specific web page or service. Do not define logics about user or account information. It must be declared in the parent User class. Also, don't define processes of a specific a web page or service. Defines them in the child Service class.
1 class protocol.service.Client
3 public replyData(invoke: protocol.Invoke): void
5 // SHIFT TO PARENT USER
6 // THE PARENT USER ALSO MAY SHIFT TO ITS PARENT SERVER
7 this.getUser().replyData(invoke);
9 // SHIFT TO BELOGED SERVICE
10 if (this.getService() != null)
11 this.getService().replyData(invoke);
15 class MyClient extends protocol.service.Client
17 public replyData(invoke: protocol.Invoke): void
19 if (invoke.getListener() == "do_something_in_client_level")
20 this.do_something_in_client_level();
22 super.replyData(invoke);
- Parameters
-
Definition at line 209 of file Client.hpp.