SNode.C
Loading...
Searching...
No Matches
core::socket::stream::legacy::SocketConnection< PhysicalSocketT, ConfigT > Class Template Referencefinal

#include <SocketConnection.h>

Inheritance diagram for core::socket::stream::legacy::SocketConnection< PhysicalSocketT, ConfigT >:
Collaboration diagram for core::socket::stream::legacy::SocketConnection< PhysicalSocketT, ConfigT >:

Public Types

using SocketAddress = typename Super::SocketAddress

Public Member Functions

 SocketConnection (PhysicalSocket &&physicalSocket, const std::function< void(SocketConnection *)> &onDisconnect, const std::shared_ptr< Config > &config)
Public Member Functions inherited from core::socket::stream::SocketConnectionT< PhysicalSocketT, core::socket::stream::legacy::SocketReader, core::socket::stream::legacy::SocketWriter, ConfigT >
 SocketConnectionT ()=delete
int getFd () const final
void setTimeout (const utils::Timeval &timeout) final
void setReadTimeout (const utils::Timeval &timeout) final
void setWriteTimeout (const utils::Timeval &timeout) final
const SocketAddressgetBindAddress () const final
const SocketAddressgetLocalAddress () const final
const SocketAddressgetRemoteAddress () const final
std::size_t readFromPeer (char *chunk, std::size_t chunkLen) final
void sendToPeer (const char *chunk, std::size_t chunkLen) final
bool streamToPeer (core::pipe::Source *source) final
void streamEof () final
void shutdownRead () final
void shutdownWrite (bool forceClose) final
void close () final
ConfiggetConfig () const
std::size_t getTotalSent () const override
std::size_t getTotalQueued () const override
std::size_t getTotalRead () const override
std::size_t getTotalProcessed () const override
void sendToPeer (const std::string &data)
Public Member Functions inherited from core::socket::stream::SocketConnection
 SocketConnection (int fd, const net::config::ConfigInstance *config)
 SocketConnection (const SocketConnection &)=delete
void setSocketContext (SocketContext *socketContext)
void sendToPeer (const std::string &data)
void sentToPeer (const std::vector< uint8_t > &data)
void sentToPeer (const std::vector< char > &data)
const std::string & getInstanceName () const
const std::string & getConnectionName () const
SocketContextgetSocketContext () const
std::string getOnlineSince () const
std::string getOnlineDuration () const
const net::config::ConfigInstancegetConfigInstance () const

Private Types

using Super
using Config = ConfigT
using PhysicalSocket = PhysicalSocketT
using SocketReader = typename Super::SocketReader
using SocketWriter = typename Super::SocketWriter

Friends

template<typename PhysicalSocket, typename Config>
class SocketAcceptor
template<typename PhysicalSocket, typename Config>
class SocketConnector

Additional Inherited Members

Protected Types inherited from core::socket::stream::SocketConnectionT< PhysicalSocketT, core::socket::stream::legacy::SocketReader, core::socket::stream::legacy::SocketWriter, ConfigT >
using Super
using Config
using PhysicalSocket
using SocketReader
using SocketWriter
using SocketAddress
Protected Member Functions inherited from core::socket::stream::SocketConnectionT< PhysicalSocketT, core::socket::stream::legacy::SocketReader, core::socket::stream::legacy::SocketWriter, ConfigT >
 SocketConnectionT (PhysicalSocket &&physicalSocket, const std::function< void()> &onDisconnect, const std::shared_ptr< Config > &config)
 ~SocketConnectionT () override
void doWriteShutdown (const std::function< void()> &onShutdown) override
void onWriteError (int errnum)
void onReadError (int errnum)
Protected Member Functions inherited from core::socket::stream::SocketConnection
virtual ~SocketConnection ()
void setSocketContext (const std::shared_ptr< SocketContextFactory > &socketContextFactory)
Protected Member Functions inherited from core::socket::stream::legacy::SocketReader
 ~SocketReader () override
Protected Member Functions inherited from core::socket::stream::SocketReader
 SocketReader (const std::string &instanceName, const std::function< void(int)> &onStatus, const utils::Timeval &timeout, std::size_t blockSize, const utils::Timeval &terminateTimeout)
std::size_t getTotalRead () const
std::size_t getTotalProcessed () const
virtual ssize_t read (char *chunk, std::size_t chunkLen)
void setBlockSize (std::size_t readBlockSize)
std::size_t readFromPeer (char *chunk, std::size_t chunkLen)
void shutdownRead ()
 SocketReader ()=delete
Protected Member Functions inherited from core::eventreceiver::ReadEventReceiver
 ReadEventReceiver (const std::string &name, const utils::Timeval &timeout)
Protected Member Functions inherited from core::DescriptorEventReceiver
bool enable (int fd)
void disable ()
void suspend ()
void resume ()
 DescriptorEventReceiver (const std::string &name, DescriptorEventPublisher &descriptorEventPublisher, const utils::Timeval &timeout=TIMEOUT::DISABLE)
int getRegisteredFd () const
bool isEnabled () const
bool isSuspended () const
void setTimeout (const utils::Timeval &timeout)
utils::Timeval getTimeout (const utils::Timeval &currentTime) const
void checkTimeout (const utils::Timeval &currentTime)
Protected Member Functions inherited from core::Observer
void observed ()
void unObserved ()
 Observer ()=default
 Observer (Observer &)=delete
 Observer (Observer &&)=delete
virtual ~Observer ()
Protected Member Functions inherited from core::EventReceiver
virtual ~EventReceiver ()=default
 EventReceiver (const std::string &name)
 EventReceiver (EventReceiver &)=delete
 EventReceiver (EventReceiver &&)=delete
EventReceiveroperator= (EventReceiver &)=delete
EventReceiveroperator= (EventReceiver &&)=delete
virtual void destruct ()
void span ()
void relax ()
const std::string & getName () const
Protected Member Functions inherited from core::socket::stream::legacy::SocketWriter
 ~SocketWriter () override
Protected Member Functions inherited from core::socket::stream::SocketWriter
 SocketWriter (const std::string &instanceName, const std::function< void(int)> &onStatus, const utils::Timeval &timeout, std::size_t blockSize, const utils::Timeval &terminateTimeout)
std::size_t getTotalSent () const
std::size_t getTotalQueued () const
virtual ssize_t write (const char *chunk, std::size_t chunkLen)
void setBlockSize (std::size_t writeBlockSize)
void sendToPeer (const char *chunk, std::size_t chunkLen)
bool streamToPeer (core::pipe::Source *source)
void streamEof ()
void shutdownWrite (const std::function< void()> &onShutdown)
 SocketWriter ()=delete
Protected Member Functions inherited from core::eventreceiver::WriteEventReceiver
 WriteEventReceiver (const std::string &name, const utils::Timeval &timeout)
Static Protected Member Functions inherited from core::EventReceiver
static void atNextTick (const std::function< void(void)> &callBack)
Protected Attributes inherited from core::socket::stream::SocketConnection
core::socket::stream::SocketContextsocketContext = nullptr
core::socket::stream::SocketContextnewSocketContext = nullptr
std::string instanceName
std::string connectionName
std::chrono::time_point< std::chrono::system_clock > onlineSinceTimePoint
Protected Attributes inherited from core::socket::stream::SocketReader
utils::Timeval terminateTimeout
Protected Attributes inherited from core::socket::stream::SocketWriter
bool markShutdown = false
std::function< void()> onShutdown
std::vector< char > writePuffer
bool shutdownInProgress = false
utils::Timeval terminateTimeout

Detailed Description

template<typename PhysicalSocketT, typename ConfigT>
class core::socket::stream::legacy::SocketConnection< PhysicalSocketT, ConfigT >

Definition at line 58 of file SocketConnection.h.

Member Typedef Documentation

◆ Config

template<typename PhysicalSocketT, typename ConfigT>
using core::socket::stream::legacy::SocketConnection< PhysicalSocketT, ConfigT >::Config = ConfigT
private

Definition at line 69 of file SocketConnection.h.

◆ PhysicalSocket

template<typename PhysicalSocketT, typename ConfigT>
using core::socket::stream::legacy::SocketConnection< PhysicalSocketT, ConfigT >::PhysicalSocket = PhysicalSocketT
private

Definition at line 70 of file SocketConnection.h.

◆ SocketAddress

template<typename PhysicalSocketT, typename ConfigT>
using core::socket::stream::legacy::SocketConnection< PhysicalSocketT, ConfigT >::SocketAddress = typename Super::SocketAddress

Definition at line 75 of file SocketConnection.h.

◆ SocketReader

template<typename PhysicalSocketT, typename ConfigT>
using core::socket::stream::legacy::SocketConnection< PhysicalSocketT, ConfigT >::SocketReader = typename Super::SocketReader
private

Definition at line 71 of file SocketConnection.h.

◆ SocketWriter

template<typename PhysicalSocketT, typename ConfigT>
using core::socket::stream::legacy::SocketConnection< PhysicalSocketT, ConfigT >::SocketWriter = typename Super::SocketWriter
private

Definition at line 72 of file SocketConnection.h.

◆ Super

Constructor & Destructor Documentation

◆ SocketConnection()

template<typename PhysicalSocket, typename Config>
core::socket::stream::legacy::SocketConnection< PhysicalSocket, Config >::SocketConnection ( PhysicalSocket && physicalSocket,
const std::function< void(SocketConnection< PhysicalSocketT, ConfigT > *)> & onDisconnect,
const std::shared_ptr< Config > & config )

◆ SocketAcceptor

template<typename PhysicalSocketT, typename ConfigT>
template<typename PhysicalSocket, typename Config>
friend class SocketAcceptor
friend

Definition at line 82 of file SocketConnection.h.

◆ SocketConnector

template<typename PhysicalSocketT, typename ConfigT>
template<typename PhysicalSocket, typename Config>
friend class SocketConnector
friend

Definition at line 85 of file SocketConnection.h.


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