Samchon Framework for CPP
1.0.0
|
#include <WebServer.hpp>
Public Member Functions | |
WebServer () | |
Public Member Functions inherited from samchon::protocol::Server | |
Server () | |
virtual | ~Server () |
virtual void | open (int port) |
virtual void | close () |
Additional Inherited Members | |
Protected Member Functions inherited from samchon::protocol::Server | |
virtual void | addClient (std::shared_ptr< ClientDriver >)=0 |
A web server.
The WebServer is an abstract class providing methods for opening a web-server and accepting web-clients. The web-server opened by this WebServer class follows the protocol of web-socket.
To open a web-server, extends the WebServer class and overrides addClient() methods to define what to do with a newly conneted remote web-clietns. At last, call open() method with the specified port number.
Below codes and classes will be good examples for comprehending how to open a server and handle remote clients.
Note that, this WebServer class follows the web-socket protocol, not Samchon Framework's own protocol. If you want to open a server following the protocol of Samchon Framework's own, then extends Server instead.
Protocol | Derived Type | Related ClientDriver |
---|---|---|
Samchon Framework's own | Server | ClientDriver |
Web-socket protocol | WebServer | WebClientDriver |
Definition at line 49 of file WebServer.hpp.
|
inline |
Default Constructor.
Definition at line 61 of file WebServer.hpp.
References samchon::protocol::Server::addClient(), samchon::WeakString::between(), samchon::WeakString::find(), samchon::library::StringUtil::substitute(), and samchon::library::Date::toLinuxTime().