SNode.C
|
#include <SocketConnection.h>
Public Member Functions | |
SocketConnectionT ()=delete | |
int | getFd () const final |
void | setTimeout (const utils::Timeval &timeout) 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 |
void | sendToPeer (const std::string &data) |
![]() | |
SocketConnection (const std::string &instanceName, int fd, const std::string &configuredServer) | |
void | switchSocketContext (SocketContext *newSocketContext) |
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 |
const std::string & | getConfiguredServer () const |
Protected Types | |
using | Super = core::socket::stream::SocketConnection |
using | PhysicalSocket = PhysicalSocketT |
using | SocketReader = SocketReaderT |
using | SocketWriter = SocketWriterT |
using | SocketAddress = typename PhysicalSocket::SocketAddress |
Protected Member Functions | |
SocketConnectionT (const std::string &instanceName, PhysicalSocket &&physicalSocket, const std::function< void()> &onDisconnect, const std::string &configuredServer, const SocketAddress &localAddress, const SocketAddress &remoteAddress, const utils::Timeval &readTimeout, const utils::Timeval &writeTimeout, std::size_t readBlockSize, std::size_t writeBlockSize, const utils::Timeval &terminateTimeout) | |
~SocketConnectionT () override | |
void | doWriteShutdown (const std::function< void()> &onShutdown) override |
void | onWriteError (int errnum) |
void | onReadError (int errnum) |
![]() | |
virtual | ~SocketConnection () |
void | setSocketContext (SocketContext *socketContext) |
void | connectSocketContext (const std::shared_ptr< SocketContextFactory > &socketContextFactory) |
void | disconnectCurrentSocketContext () |
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 {} |
Additional Inherited Members | |
![]() | |
core::socket::stream::SocketContext * | socketContext = nullptr |
core::socket::stream::SocketContext * | newSocketContext = nullptr |
std::string | instanceName |
std::string | connectionName |
std::string | configuredServer |
Definition at line 129 of file SocketConnection.h.
|
protected |
Definition at line 136 of file SocketConnection.h.
|
protected |
Definition at line 139 of file SocketConnection.h.
|
protected |
Definition at line 137 of file SocketConnection.h.
|
protected |
Definition at line 138 of file SocketConnection.h.
|
protected |
Definition at line 134 of file SocketConnection.h.
|
delete |
|
protected |
Definition at line 59 of file SocketConnection.hpp.
|
overrideprotected |
Definition at line 117 of file SocketConnection.hpp.
|
finalvirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 201 of file SocketConnection.hpp.
Referenced by core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT >::onReceivedFromPeer(), core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT >::readTimeout(), core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT >::shutdownWrite(), and core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT >::writeTimeout().
|
overrideprotected |
Definition at line 211 of file SocketConnection.hpp.
References core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT >::physicalSocket, and core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT >::setTimeout().
|
finalvirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 127 of file SocketConnection.hpp.
References core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT >::physicalSocket.
|
finalvirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 133 of file SocketConnection.hpp.
References core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT >::localAddress.
|
finalvirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 139 of file SocketConnection.hpp.
References core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT >::remoteAddress.
|
protected |
Definition at line 251 of file SocketConnection.hpp.
|
finalprivate |
Definition at line 228 of file SocketConnection.hpp.
References core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT >::close(), and core::socket::stream::SocketConnection::disconnectCurrentSocketContext().
|
finalprivate |
Definition at line 256 of file SocketConnection.hpp.
|
protected |
Definition at line 246 of file SocketConnection.hpp.
|
finalvirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 144 of file SocketConnection.hpp.
|
finalprivate |
Definition at line 276 of file SocketConnection.hpp.
References core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT >::close().
|
finalvirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 157 of file SocketConnection.hpp.
void core::socket::stream::SocketConnection::sendToPeer | ( | const std::string & | data | ) |
Definition at line 90 of file SocketConnection.cpp.
|
finalvirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 121 of file SocketConnection.hpp.
Referenced by core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT >::doWriteShutdown().
|
finalvirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 172 of file SocketConnection.hpp.
References core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT >::physicalSocket.
|
finalvirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 185 of file SocketConnection.hpp.
References core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT >::close().
|
finalvirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 167 of file SocketConnection.hpp.
|
finalvirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 162 of file SocketConnection.hpp.
|
finalprivate |
Definition at line 288 of file SocketConnection.hpp.
References core::socket::stream::SocketConnection::disconnectCurrentSocketContext().
|
finalprivate |
Definition at line 282 of file SocketConnection.hpp.
References core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT >::close().
|
private |
Definition at line 199 of file SocketConnection.h.
Referenced by core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT >::getLocalAddress().
|
private |
Definition at line 197 of file SocketConnection.h.
|
private |
Definition at line 195 of file SocketConnection.h.
Referenced by core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT >::doWriteShutdown(), core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT >::getFd(), and core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT >::shutdownRead().
|
private |
Definition at line 200 of file SocketConnection.h.
Referenced by core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT >::getRemoteAddress().