Samchon Framework for CPP  1.0.0
samchon::protocol::IWebClientBase Class Referenceabstract

An interface for a web-client. More...

#include <IWebClientBase.hpp>

Collaboration diagram for samchon::protocol::IWebClientBase:

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...
 
- Public Member Functions inherited from samchon::protocol::IClient
 IClient ()
 Default Constructor. More...
 
- Public Member Functions inherited from samchon::protocol::IProtocol
 IProtocol ()
 Default Constructor. More...
 
virtual void replyData (std::shared_ptr< Invoke >)
 Reply a message. More...
 

Additional Inherited Members

- Protected Member Functions inherited from samchon::protocol::IClient
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...
 
- Protected Attributes inherited from samchon::protocol::IClient
Socket * socket
 Socket for network I/O. More...
 
std::mutex * sendMtx
 A mutex for sending message. More...
 

Detailed Description

An interface for a web-client.

IWebClient is a IClient following web-socket protocol.

[Inherited]

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().

protocol_interface.png
Author
Jeongho Nam http://samchon.org

Definition at line 32 of file IWebClientBase.hpp.

Constructor & Destructor Documentation

IWebClientBase::IWebClientBase ( )

Default Constructor.

Definition at line 20 of file IWebClientBase.cpp.

Member Function Documentation

void IWebClientBase::listen ( )
overridevirtual

Listens message from a related system.

Note
It holds (monopolies) a thread.

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().

Here is the call graph for this function:

void IWebClientBase::sendData ( std::shared_ptr< Invoke )
overridevirtual

Sends message to a related system.

Parameters
invokeInvoke 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().

Here is the call graph for this function:


The documentation for this class was generated from the following files: