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 107 of file SocketConnection.h.
|
protected |
Definition at line 114 of file SocketConnection.h.
|
protected |
Definition at line 117 of file SocketConnection.h.
|
protected |
Definition at line 115 of file SocketConnection.h.
|
protected |
Definition at line 116 of file SocketConnection.h.
|
protected |
Definition at line 112 of file SocketConnection.h.
|
delete |
|
protected |
Definition at line 37 of file SocketConnection.hpp.
|
overrideprotected |
Definition at line 95 of file SocketConnection.hpp.
|
finalvirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 179 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 189 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 105 of file SocketConnection.hpp.
References core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT >::physicalSocket.
|
finalvirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 111 of file SocketConnection.hpp.
References core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT >::localAddress.
|
finalvirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 117 of file SocketConnection.hpp.
References core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT >::remoteAddress.
|
protected |
Definition at line 229 of file SocketConnection.hpp.
|
finalprivate |
Definition at line 206 of file SocketConnection.hpp.
References core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT >::close(), and core::socket::stream::SocketConnection::disconnectCurrentSocketContext().
|
finalprivate |
Definition at line 234 of file SocketConnection.hpp.
|
protected |
Definition at line 224 of file SocketConnection.hpp.
|
finalvirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 122 of file SocketConnection.hpp.
|
finalprivate |
Definition at line 254 of file SocketConnection.hpp.
References core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT >::close().
|
finalvirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 135 of file SocketConnection.hpp.
void core::socket::stream::SocketConnection::sendToPeer | ( | const std::string & | data | ) |
Definition at line 68 of file SocketConnection.cpp.
|
finalvirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 99 of file SocketConnection.hpp.
Referenced by core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT >::doWriteShutdown().
|
finalvirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 150 of file SocketConnection.hpp.
References core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT >::physicalSocket.
|
finalvirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 163 of file SocketConnection.hpp.
References core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT >::close().
|
finalvirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 145 of file SocketConnection.hpp.
|
finalvirtual |
Implements core::socket::stream::SocketConnection.
Definition at line 140 of file SocketConnection.hpp.
|
finalprivate |
Definition at line 266 of file SocketConnection.hpp.
References core::socket::stream::SocketConnection::disconnectCurrentSocketContext().
|
finalprivate |
Definition at line 260 of file SocketConnection.hpp.
References core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT >::close().
|
private |
Definition at line 177 of file SocketConnection.h.
Referenced by core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT >::getLocalAddress().
|
private |
Definition at line 175 of file SocketConnection.h.
|
private |
Definition at line 173 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 178 of file SocketConnection.h.
Referenced by core::socket::stream::SocketConnectionT< PhysicalSocketT, SocketReaderT, SocketWriterT >::getRemoteAddress().