SNode.C
Loading...
Searching...
No Matches
iot::mqtt::SocketContext Class Reference

#include <SocketContext.h>

Inheritance diagram for iot::mqtt::SocketContext:
Collaboration diagram for iot::mqtt::SocketContext:

Public Member Functions

 SocketContext (core::socket::stream::SocketConnection *socketConnection, Mqtt *mqtt)
 
- Public Member Functions inherited from core::socket::stream::SocketContext
 SocketContext (core::socket::stream::SocketConnection *socketConnection)
 
void sendToPeer (const char *chunk, std::size_t chunkLen) const final
 
bool streamToPeer (core::pipe::Source *source) const
 
void streamEof ()
 
std::size_t readFromPeer (char *chunk, std::size_t chunklen) const final
 
void setTimeout (const utils::Timeval &timeout) final
 
void shutdownRead ()
 
void shutdownWrite (bool forceClose=false)
 
SocketConnectiongetSocketConnection () const
 
virtual void switchSocketContext (SocketContext *newSocketContext)
 
void sendToPeer (const std::string &data) const
 
- Public Member Functions inherited from core::socket::SocketContext
 SocketContext (const SocketContext &)=delete
 
 SocketContext (SocketContext &&)=delete
 
SocketContextoperator= (const SocketContext &)=delete
 
SocketContextoperator= (SocketContext &&)=delete
 
void sendToPeer (const std::string &data) const
 

Private Member Functions

void onConnected () override
 
std::size_t onReceivedFromPeer () override
 
void onDisconnected () override
 
bool onSignal (int sig) override
 
core::socket::stream::SocketConnectiongetSocketConnection () const override
 
std::size_t recv (char *chunk, std::size_t chunklen) override
 
void send (const char *chunk, std::size_t chunklen) override
 
void end (bool fatal) override
 
void close () override
 
- Private Member Functions inherited from iot::mqtt::MqttContext
 MqttContext (Mqtt *mqtt)
 
 MqttContext (const MqttContext &)=default
 
MqttContextoperator= (const MqttContext &)=default
 
virtual ~MqttContext ()
 
void onConnected ()
 
std::size_t onReceivedFromPeer ()
 
void onDisconnected ()
 
bool onSignal (int sig)
 

Additional Inherited Members

- Protected Member Functions inherited from core::socket::stream::SocketContext
void onWriteError (int errnum) override
 
void onReadError (int errnum) override
 
- Protected Member Functions inherited from core::socket::SocketContext
 SocketContext ()=default
 
virtual ~SocketContext ()
 
- Private Attributes inherited from iot::mqtt::MqttContext
Mqttmqtt
 

Detailed Description

Definition at line 42 of file SocketContext.h.

Constructor & Destructor Documentation

◆ SocketContext()

iot::mqtt::SocketContext::SocketContext ( core::socket::stream::SocketConnection * socketConnection,
Mqtt * mqtt )
explicit

Definition at line 28 of file SocketContext.cpp.

References iot::mqtt::MqttContext::MqttContext(), and core::socket::stream::SocketContext::SocketContext().

Here is the call graph for this function:

Member Function Documentation

◆ close()

void iot::mqtt::SocketContext::close ( )
overrideprivatevirtual

Reimplemented from core::socket::stream::SocketContext.

Definition at line 65 of file SocketContext.cpp.

References core::socket::stream::SocketContext::close().

Here is the call graph for this function:

◆ end()

void iot::mqtt::SocketContext::end ( bool fatal)
overrideprivatevirtual

Implements iot::mqtt::MqttContext.

Definition at line 61 of file SocketContext.cpp.

61 {
62 shutdownWrite(fatal);
63 }
void shutdownWrite(bool forceClose=false)

References core::socket::stream::SocketContext::shutdownWrite().

Here is the call graph for this function:

◆ getSocketConnection()

core::socket::stream::SocketConnection * iot::mqtt::SocketContext::getSocketConnection ( ) const
overrideprivatevirtual

Implements iot::mqtt::MqttContext.

Definition at line 45 of file SocketContext.cpp.

References core::socket::stream::SocketContext::getSocketConnection().

Here is the call graph for this function:

◆ onConnected()

void iot::mqtt::SocketContext::onConnected ( )
overrideprivatevirtual

Implements core::socket::stream::SocketContext.

Definition at line 33 of file SocketContext.cpp.

References iot::mqtt::MqttContext::onConnected().

Here is the call graph for this function:

◆ onDisconnected()

void iot::mqtt::SocketContext::onDisconnected ( )
overrideprivatevirtual

Implements core::socket::stream::SocketContext.

Definition at line 37 of file SocketContext.cpp.

References iot::mqtt::MqttContext::onDisconnected().

Here is the call graph for this function:

◆ onReceivedFromPeer()

std::size_t iot::mqtt::SocketContext::onReceivedFromPeer ( )
overrideprivatevirtual

Implements core::socket::SocketContext.

Definition at line 49 of file SocketContext.cpp.

49 {
51 }
std::size_t onReceivedFromPeer()

References iot::mqtt::MqttContext::onReceivedFromPeer().

Here is the call graph for this function:

◆ onSignal()

bool iot::mqtt::SocketContext::onSignal ( int sig)
overrideprivatevirtual

Implements core::socket::SocketContext.

Definition at line 41 of file SocketContext.cpp.

41 {
43 }

References iot::mqtt::MqttContext::onSignal().

Here is the call graph for this function:

◆ recv()

std::size_t iot::mqtt::SocketContext::recv ( char * chunk,
std::size_t chunklen )
overrideprivatevirtual

Implements iot::mqtt::MqttContext.

Definition at line 53 of file SocketContext.cpp.

53 {
54 return readFromPeer(chunk, chunklen);
55 }
std::size_t readFromPeer(char *chunk, std::size_t chunklen) const final

References core::socket::stream::SocketContext::readFromPeer().

Here is the call graph for this function:

◆ send()

void iot::mqtt::SocketContext::send ( const char * chunk,
std::size_t chunklen )
overrideprivatevirtual

Implements iot::mqtt::MqttContext.

Definition at line 57 of file SocketContext.cpp.

57 {
58 sendToPeer(chunk, chunklen);
59 }
void sendToPeer(const char *chunk, std::size_t chunkLen) const final

References core::socket::stream::SocketContext::sendToPeer().

Here is the call graph for this function:

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