#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 () 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 |
| 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 |
| SocketContext * | getSocketContext () const |
| std::string | getOnlineSince () const |
| std::string | getOnlineDuration () const |
| const net::config::ConfigInstance * | getConfigInstance () 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()> &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) |
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 |
| core::socket::stream::SocketContext * | newSocketContext = 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::getConnectionName(), onReadError(), and utils::PreserveErrno::PreserveErrno().
|
overrideprotected |
Definition at line 158 of file SocketConnection.hpp.
|
finalvirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 254 of file SocketConnection.hpp.
Referenced by onReceivedFromPeer(), readTimeout(), and writeTimeout().
|
overrideprotected |
Definition at line 289 of file SocketConnection.hpp.
References core::socket::stream::SocketConnection::connectionName, physicalSocket, and 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 264 of file SocketConnection.hpp.
References config.
|
finalvirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 177 of file SocketConnection.hpp.
References physicalSocket.
|
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.
References remoteAddress.
Referenced by tls::getClient(), legacy::getLegacyClient(), and main().
|
overridevirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 284 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 279 of file SocketConnection.hpp.
|
overridevirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 269 of file SocketConnection.hpp.
|
protected |
Definition at line 334 of file SocketConnection.hpp.
References core::socket::stream::SocketContext::onReadError(), and core::socket::stream::SocketConnection::socketContext.
Referenced by SocketConnectionT().
|
finalprivate |
Definition at line 306 of file SocketConnection.hpp.
References core::socket::stream::SocketContext::attach(), close(), core::socket::stream::SocketConnection::connectionName, core::socket::stream::SocketContext::detach(), core::socket::stream::SocketConnection::newSocketContext, core::socket::stream::SocketContext::readFromPeer(), and core::socket::stream::SocketConnection::socketContext.
|
finalprivate |
Definition at line 339 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 329 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 359 of file SocketConnection.hpp.
References close(), and core::socket::stream::SocketConnection::connectionName.
|
finalvirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 213 of file SocketConnection.hpp.
| void core::socket::stream::SocketConnection::sendToPeer | ( | const std::string & | data | ) |
Definition at line 98 of file SocketConnection.cpp.
|
finalvirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 168 of file SocketConnection.hpp.
Referenced by setTimeout().
|
finalvirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 162 of file SocketConnection.hpp.
References setReadTimeout(), and setWriteTimeout().
Referenced by doWriteShutdown().
|
finalvirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 172 of file SocketConnection.hpp.
Referenced by setTimeout().
|
finalvirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 228 of file SocketConnection.hpp.
References core::socket::stream::SocketConnection::connectionName, and physicalSocket.
|
finalvirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 241 of file SocketConnection.hpp.
References core::socket::stream::SocketConnection::connectionName.
|
finalvirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 223 of file SocketConnection.hpp.
|
finalvirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 218 of file SocketConnection.hpp.
|
finalprivate |
Definition at line 371 of file SocketConnection.hpp.
References core::socket::stream::SocketConnection::connectionName, core::socket::stream::SocketContext::detach(), onDisconnect, and core::socket::stream::SocketConnection::socketContext.
|
finalprivate |
Definition at line 365 of file SocketConnection.hpp.
References close(), and core::socket::stream::SocketConnection::connectionName.
|
private |
Definition at line 235 of file SocketConnection.h.
Referenced by getConfig().
|
private |
Definition at line 232 of file SocketConnection.h.
|
private |
Definition at line 230 of file SocketConnection.h.
Referenced by unobservedEvent().
|
private |
Definition at line 228 of file SocketConnection.h.
Referenced by doWriteShutdown(), getFd(), and shutdownRead().
|
private |