Samchon Framework for CPP
1.0.0
|
An interface for a web-client. More...
#include <IWebClientBase.hpp>
Public Member Functions | |
IWebClientBase () | |
Default Constructor. More... | |
virtual void | listen () override |
Listens message from a related system. More... | |
virtual void | sendData (std::shared_ptr< Invoke >) override |
Sends message to a related system. More... | |
![]() | |
IClient () | |
Default Constructor. More... | |
![]() | |
IProtocol () | |
Default Constructor. More... | |
virtual void | replyData (std::shared_ptr< Invoke >) |
Reply a message. More... | |
Additional Inherited Members | |
![]() | |
virtual auto | BUFFER_SIZE () const -> size_t |
Buffer size of network I/O. More... | |
virtual void | _replyData (std::shared_ptr< Invoke >) |
A method for pre-processing replied Invoke message. More... | |
![]() | |
Socket * | socket |
Socket for network I/O. More... | |
std::mutex * | sendMtx |
A mutex for sending message. More... | |
An interface for a web-client.
IWebClient is a IClient following web-socket protocol.
IClient is an interface not only for a physical client, but also a driver for a client in a physical server.
IClient is one of the basic 3 + 1 components that can make any type of network system in Samchon Framework with IProtocol and IServer. Looking around classes in Samchon Framework, you can see all classes related with client are implemented from the IClient.
IClient takes a role of real network I/O. IClient sends data to otherside network system from IProtocol::sendData(). IClient also gets data from otherside network system, generates standard Invoke message from parsing the replied data and shift the Invoke message to IProtocol::replyData().
Definition at line 32 of file IWebClientBase.hpp.
IWebClientBase::IWebClientBase | ( | ) |
Default Constructor.
Definition at line 20 of file IWebClientBase.cpp.
|
overridevirtual |
Listens message from a related system.
Reimplemented from samchon::protocol::IClient.
Definition at line 28 of file IWebClientBase.cpp.
References samchon::protocol::IClient::_replyData(), samchon::protocol::IClient::BUFFER_SIZE(), samchon::ByteArray::getPosition(), samchon::ByteArray::read(), samchon::ByteArray::readReversely(), samchon::protocol::IClient::socket, and samchon::ByteArray::write().
|
overridevirtual |
Sends message to a related system.
invoke | Invoke message to send |
Reimplemented from samchon::protocol::IClient.
Definition at line 184 of file IWebClientBase.cpp.
References samchon::protocol::IClient::sendMtx, samchon::protocol::IClient::socket, samchon::ByteArray::write(), and samchon::ByteArray::writeReversely().