Samchon Framework for CPP
1.0.0
|
#include <WebClientDriver.hpp>
Public Member Functions | |
auto | getSessionID () const -> std::string |
auto | getPath () const -> std::string |
Public Member Functions inherited from samchon::protocol::ClientDriver | |
void | listen (IProtocol *listener) |
Public Member Functions inherited from samchon::protocol::Communicator | |
virtual void | close () |
virtual void | replyData (std::shared_ptr< Invoke > invoke) |
Public Member Functions inherited from samchon::protocol::WebCommunicator | |
virtual void | sendData (std::shared_ptr< Invoke > invoke) override |
A communicator with remote web-client.
The WebClientDriver class is a type of WebCommunicator, specified for communication with remote web-client who has connected in a WebServer object who follows the protocol of web-socket. The WebClientDriver takes full charge of network communication with the remote web-client.
The WebClientDriver object is always created by WebServer class. When you got this WebClientDriver object from the WebServer.addClient(), then specify listener with the WebClientDriver.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 |
Unlike other protocol, Web-socket protocol's clients notify two parameters on their connection; session-id and path. The session-id can be used to identify user of each client, and the path can be used which type of service that client wants. In service module, you can see the best utilization case of them.
Definition at line 46 of file WebClientDriver.hpp.
|
inline |
Get session ID, an identifier of the remote client.
Definition at line 70 of file WebClientDriver.hpp.
Referenced by samchon::templates::service::Server::addClient().
|
inline |
Get requested path.
Definition at line 78 of file WebClientDriver.hpp.