Samchon Framework for CPP
1.0.0
|
#include <ClientDriver.hpp>
Public Member Functions | |
void | listen (IProtocol *listener) |
Public Member Functions inherited from samchon::protocol::Communicator | |
virtual void | close () |
virtual void | replyData (std::shared_ptr< Invoke > invoke) |
virtual void | sendData (std::shared_ptr< Invoke > invoke) |
A communicator with remote client.
The ClientDriver class is a type of Communicator, specified for communication with remote client who has connected in a Server object who follows the protocol of Samchon Framework's own. The ClientDriver takes full charge of network communication with the remote client.
The ClientDriver object is always created by the Server class. When you got a ClientDriver object from the Server.addClient(), then specify listener with the ClientDriver.listen() method. Below code is an example specifying and managing the listener objects.
Protocol | Derived Type | Created By |
---|---|---|
Samchon Framework's own | ClientDriver | Server |
Web-socket protocol | WebClientDriver | WebServer |
Definition at line 37 of file ClientDriver.hpp.
|
inline |
Listen message from the newly connected client.
Starts listening message from the newly connected client. Replied message from the connected client will be converted to Invoke classes and shifted to the listener's replyData() method.
listener | A listener object to listen replied message from newly connected client in replyData() as an Invoke object. |
Definition at line 58 of file ClientDriver.hpp.