#include <SocketWriter.h>
|
static void | atNextTick (const std::function< void(void)> &callBack) |
|
static void | atNextTick (const std::function< void(void)> &callBack) |
|
Definition at line 43 of file SocketWriter.h.
◆ SocketWriter() [1/2]
core::socket::stream::SocketWriter::SocketWriter |
( |
| ) |
|
|
delete |
◆ SocketWriter() [2/2]
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 ) |
|
explicitprotected |
Definition at line 35 of file SocketWriter.cpp.
44 }
utils::Timeval terminateTimeout
std::function< void(int)> onStatus
◆ doWrite()
void core::socket::stream::SocketWriter::doWrite |
( |
| ) |
|
|
private |
Definition at line 62 of file SocketWriter.cpp.
62 {
66
67 if (retWrite > 0) {
69
72 }
73
76 }
78 }
else if ((errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR) &&
isSuspended()) {
80 } else {
82 }
83 } else {
86 }
87
91 }
else if (
source !=
nullptr) {
93 }
94 }
95 }
const std::string & getName() const
virtual void doWriteShutdown(const std::function< void()> &onShutdown)=0
core::pipe::Source * source
std::vector< char > writePuffer
std::function< void()> onShutdown
virtual ssize_t write(const char *chunk, std::size_t chunkLen)
◆ doWriteShutdown()
virtual void core::socket::stream::SocketWriter::doWriteShutdown |
( |
const std::function< void()> & | onShutdown | ) |
|
|
privatepure virtual |
◆ onSignal()
virtual bool core::socket::stream::SocketWriter::onSignal |
( |
int | sigNum | ) |
|
|
privatepure virtual |
◆ sendToPeer()
void core::socket::stream::SocketWriter::sendToPeer |
( |
const char * | chunk, |
|
|
std::size_t | chunkLen ) |
|
protected |
Definition at line 101 of file SocketWriter.cpp.
101 {
106 }
107
109
112 }
113 } else {
114 LOG(WARNING) <<
getName() <<
": Send while not enabled";
115 }
116 } else {
117 LOG(WARNING) <<
getName() <<
": Send while shutdown in progress";
118 }
119 }
◆ setBlockSize()
void core::socket::stream::SocketWriter::setBlockSize |
( |
std::size_t | writeBlockSize | ) |
|
|
protected |
◆ shutdownWrite()
void core::socket::stream::SocketWriter::shutdownWrite |
( |
const std::function< void()> & | onShutdown | ) |
|
|
protected |
Definition at line 150 of file SocketWriter.cpp.
150 {
153
158 } else {
160 LOG(
TRACE) <<
getName() <<
": Shutdown delayed due to queued data";
161 }
162 }
163 }
◆ signalEvent()
void core::socket::stream::SocketWriter::signalEvent |
( |
int | sigNum | ) |
|
|
finalprivatevirtual |
◆ streamEof()
void core::socket::stream::SocketWriter::streamEof |
( |
| ) |
|
|
protected |
◆ streamToPeer()
Definition at line 121 of file SocketWriter.cpp.
121 {
122 bool success = false;
123
126 success =
source !=
nullptr;
127
128 if (success) {
130 } else {
131 LOG(WARNING) <<
getName() <<
": Stream source is nullptr";
132 }
133 } else {
134 LOG(WARNING) <<
getName() <<
": Stream while not enabled";
135 }
136 } else {
137 LOG(WARNING) <<
getName() <<
": Stream while shutdown in progress";
138 }
139
141
142 return success;
143 }
◆ write()
ssize_t core::socket::stream::SocketWriter::write |
( |
const char * | chunk, |
|
|
std::size_t | chunkLen ) |
|
protectedvirtual |
◆ writeEvent()
void core::socket::stream::SocketWriter::writeEvent |
( |
| ) |
|
|
finalprivatevirtual |
◆ blockSize
std::size_t core::socket::stream::SocketWriter::blockSize = 0 |
|
private |
◆ markShutdown
bool core::socket::stream::SocketWriter::markShutdown = false |
|
protected |
◆ onShutdown
std::function<void()> core::socket::stream::SocketWriter::onShutdown |
|
protected |
◆ onStatus
std::function<void(int)> core::socket::stream::SocketWriter::onStatus |
|
private |
◆ shutdownInProgress
bool core::socket::stream::SocketWriter::shutdownInProgress = false |
|
protected |
◆ source
◆ terminateTimeout
◆ writePuffer
std::vector<char> core::socket::stream::SocketWriter::writePuffer |
|
protected |
The documentation for this class was generated from the following files: