Samchon Framework for CPP
1.0.0
|
An interface of a physical server. More...
#include <IServer.hpp>
Public Member Functions | |
IServer () | |
Default Constructor. More... | |
virtual void | open () |
Open the server. More... | |
virtual void | close () |
Close the server. More... | |
Protected Member Functions | |
virtual auto | MY_IP () const -> std::string |
(optional) Server's IP More... | |
virtual auto | PORT () const -> int=NULL |
Port number of the server. More... | |
virtual void | addClient (Socket *)=0 |
Handling connection of a physical client. More... | |
Protected Attributes | |
Acceptor * | acceptor |
An acceptor for clients. More... | |
An interface of a physical server.
IServer provides methods for opening a server.
IServer is one of the basic 3 + 1 components that can make any type of network system in Samchon Framework with IProtocol and IClient. Looking around classes in Samchon Framework, you can see all servers are implemented from the IServer.
When a client connects to the server, the abstract method IServer::addClient() is called with a new thread. If you want to accept only a client at a time, use OneToOneServer instead.
A simple chat server running on console
Definition at line 43 of file IServer.hpp.
IServer::IServer | ( | ) |
Default Constructor.
Definition at line 18 of file IServer.cpp.
|
protectedvirtual |
(optional) Server's IP
Reimplemented in samchon::protocol::ExternalClientArray.
Definition at line 16 of file IServer.cpp.
Referenced by samchon::protocol::IWebServer::open().
|
protectedvirtual |
Port number of the server.
Reimplemented in samchon::example::interaction::ChiefDriver, samchon::example::console_chat_server::ChatServer, samchon::protocol::ExternalClientArray, and samchon::example::chat_service::ChatServer.
Referenced by samchon::protocol::IWebServer::open().
|
virtual |
Open the server.
Reimplemented in samchon::protocol::IWebServer.
Definition at line 30 of file IServer.cpp.
References addClient().
Referenced by samchon::example::interaction::Reporter::main(), and samchon::protocol::ExternalClientArray::start().
|
virtual |
Close the server.
Definition at line 67 of file IServer.cpp.
|
protectedpure virtual |
Handling connection of a physical client.
Implemented in samchon::example::interaction::Master, samchon::protocol::service::Server, samchon::example::interaction::PackerMediator, samchon::example::interaction::ChiefDriver, samchon::example::console_chat_server::ChatServer, samchon::example::interaction::Reporter, and samchon::protocol::ExternalClientArray.
Referenced by samchon::protocol::IWebServer::open(), and open().
|
protected |
An acceptor for clients.
Definition at line 49 of file IServer.hpp.
Referenced by samchon::protocol::IWebServer::open().