|
SNode.C
|
#include <SocketConnection.h>
Public Member Functions | |
| 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 SocketAddress & | getBindAddress () const final |
| const SocketAddress & | getLocalAddress () const final |
| const SocketAddress & | getRemoteAddress () 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 |
| Config & | getConfig () 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 |
| virtual void | sendToPeer (const char *chunk, std::size_t chunkLen)=0 |
| 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 | 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 |
| SocketContext * | getSocketContext () const |
| std::string | getOnlineSince () const |
| std::string | getOnlineDuration () const |
| const net::config::ConfigInstance * | getConfig () const |
Protected Types | |
| using | Super = core::socket::stream::SocketConnection |
| using | Config = ConfigT |
| using | PhysicalSocket = PhysicalSocketT |
| using | SocketReader = SocketReaderT |
| using | SocketWriter = SocketWriterT |
| using | SocketAddress = typename PhysicalSocket::SocketAddress |
Protected Member Functions | |
| SocketConnectionT (PhysicalSocket &&physicalSocket, const std::function< void()> &onDisconnectm, 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) |
Private Member Functions | |
| void | onReceivedFromPeer (std::size_t available) final |
| bool | onSignal (int signum) final |
| void | readTimeout () final |
| void | writeTimeout () final |
| void | unobservedEvent () final |
Private Attributes | |
| PhysicalSocket | physicalSocket |
| std::function< void()> | onDisconnect |
| SocketAddress | localAddress {} |
| SocketAddress | remoteAddress {} |
| std::shared_ptr< Config > | config |
Additional Inherited Members | |
Protected Attributes inherited from core::socket::stream::SocketConnection | |
| core::socket::stream::SocketContext * | socketContext = nullptr |
| std::string | instanceName |
| std::string | connectionName |
| std::chrono::time_point< std::chrono::system_clock > | onlineSinceTimePoint |
Definition at line 158 of file SocketConnection.h.
|
protected |
Definition at line 165 of file SocketConnection.h.
|
protected |
Definition at line 166 of file SocketConnection.h.
|
protected |
Definition at line 169 of file SocketConnection.h.
|
protected |
Definition at line 167 of file SocketConnection.h.
|
protected |
Definition at line 168 of file SocketConnection.h.
|
protected |
Definition at line 163 of file SocketConnection.h.
|
delete |
|
protected |
Definition at line 107 of file SocketConnection.hpp.
References core::socket::stream::SocketConnection::connectionName, core::socket::stream::SocketConnection::instanceName, core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT, ConfigT >::onReadError(), and utils::PreserveErrno::PreserveErrno().
|
overrideprotected |
Definition at line 158 of file SocketConnection.hpp.
|
finalvirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 249 of file SocketConnection.hpp.
Referenced by core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT, ConfigT >::readTimeout(), core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT, ConfigT >::shutdownWrite(), and core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT, ConfigT >::writeTimeout().
|
overrideprotected |
Definition at line 284 of file SocketConnection.hpp.
References core::socket::stream::SocketConnection::connectionName, core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT, ConfigT >::physicalSocket, and core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT, ConfigT >::setTimeout().
|
finalvirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 183 of file SocketConnection.hpp.
| Config & core::socket::stream::SocketConnectionT< PhysicalSocket, SocketReader, SocketWriter, Config >::getConfig | ( | ) | const |
Definition at line 259 of file SocketConnection.hpp.
References core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT, ConfigT >::config.
|
finalvirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 177 of file SocketConnection.hpp.
|
finalvirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 189 of file SocketConnection.hpp.
Referenced by tls::getClient(), legacy::getLegacyClient(), and main().
|
finalvirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 195 of file SocketConnection.hpp.
Referenced by tls::getClient(), legacy::getLegacyClient(), and main().
|
overridevirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 279 of file SocketConnection.hpp.
|
overridevirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 269 of file SocketConnection.hpp.
|
overridevirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 274 of file SocketConnection.hpp.
|
overridevirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 264 of file SocketConnection.hpp.
|
protected |
Definition at line 311 of file SocketConnection.hpp.
References core::socket::stream::SocketContext::onReadError(), and core::socket::stream::SocketConnection::socketContext.
Referenced by core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT, ConfigT >::SocketConnectionT().
|
finalprivate |
Definition at line 301 of file SocketConnection.hpp.
References core::socket::stream::SocketContext::readFromPeer(), and core::socket::stream::SocketConnection::socketContext.
|
finalprivate |
Definition at line 316 of file SocketConnection.hpp.
References core::socket::stream::SocketConnection::connectionName, core::socket::SocketContext::onSignal(), utils::system::sigabbrev_np(), and core::socket::stream::SocketConnection::socketContext.
|
protected |
Definition at line 306 of file SocketConnection.hpp.
References core::socket::stream::SocketContext::onWriteError(), and core::socket::stream::SocketConnection::socketContext.
|
finalvirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 200 of file SocketConnection.hpp.
|
finalprivate |
Definition at line 336 of file SocketConnection.hpp.
References core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT, ConfigT >::close(), and core::socket::stream::SocketConnection::connectionName.
|
finalvirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 205 of file SocketConnection.hpp.
|
virtual |
Implements core::socket::stream::SocketConnection.
| void core::socket::stream::SocketConnection::sendToPeer | ( | const std::string & | data | ) |
Definition at line 99 of file SocketConnection.cpp.
|
finalvirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 168 of file SocketConnection.hpp.
Referenced by core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT, ConfigT >::setTimeout().
|
finalvirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 162 of file SocketConnection.hpp.
References core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT, ConfigT >::setReadTimeout(), and core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT, ConfigT >::setWriteTimeout().
Referenced by core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT, ConfigT >::doWriteShutdown().
|
finalvirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 172 of file SocketConnection.hpp.
Referenced by core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT, ConfigT >::setTimeout().
|
finalvirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 220 of file SocketConnection.hpp.
|
finalvirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 233 of file SocketConnection.hpp.
References core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT, ConfigT >::close(), and core::socket::stream::SocketConnection::connectionName.
|
finalvirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 215 of file SocketConnection.hpp.
|
finalvirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 210 of file SocketConnection.hpp.
|
finalprivate |
Definition at line 348 of file SocketConnection.hpp.
References core::socket::stream::SocketConnection::connectionName, core::socket::stream::SocketContext::detach(), core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT, ConfigT >::onDisconnect, and core::socket::stream::SocketConnection::socketContext.
|
finalprivate |
Definition at line 342 of file SocketConnection.hpp.
References core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT, ConfigT >::close(), and core::socket::stream::SocketConnection::connectionName.
|
private |
Definition at line 235 of file SocketConnection.h.
Referenced by core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT, ConfigT >::getConfig().
|
private |
Definition at line 232 of file SocketConnection.h.
|
private |
Definition at line 230 of file SocketConnection.h.
Referenced by core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT, ConfigT >::unobservedEvent().
|
private |
|
private |
Definition at line 233 of file SocketConnection.h.
Referenced by core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT, ConfigT >::getRemoteAddress().