#include <SocketWriter.h>
|
static void | atNextTick (const std::function< void(void)> &callBack) |
|
static void | atNextTick (const std::function< void(void)> &callBack) |
|
Definition at line 65 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 57 of file SocketWriter.cpp.
66 }
utils::Timeval terminateTimeout
std::function< void(int)> onStatus
◆ doWrite()
void core::socket::stream::SocketWriter::doWrite |
( |
| ) |
|
|
private |
Definition at line 84 of file SocketWriter.cpp.
84 {
88
89 if (retWrite > 0) {
91
94 }
95
98 }
100 }
else if ((errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR) &&
isSuspended()) {
102 } else {
103 onStatus(retWrite == 0 ? 0 : errno);
104 }
105 } else {
108 }
109
113 }
else if (
source !=
nullptr) {
115 }
116 }
117 }
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 123 of file SocketWriter.cpp.
123 {
128 }
129
131
134 }
135 } else {
136 LOG(WARNING) <<
getName() <<
": Send while not enabled";
137 }
138 } else {
139 LOG(WARNING) <<
getName() <<
": Send while shutdown in progress";
140 }
141 }
◆ 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 172 of file SocketWriter.cpp.
172 {
175
180 } else {
182 LOG(
TRACE) <<
getName() <<
": Shutdown delayed due to queued data";
183 }
184 }
185 }
◆ signalEvent()
void core::socket::stream::SocketWriter::signalEvent |
( |
int | sigNum | ) |
|
|
finalprivatevirtual |
◆ streamEof()
void core::socket::stream::SocketWriter::streamEof |
( |
| ) |
|
|
protected |
◆ streamToPeer()
Definition at line 143 of file SocketWriter.cpp.
143 {
144 bool success = false;
145
148 success =
source !=
nullptr;
149
150 if (success) {
152 } else {
153 LOG(WARNING) <<
getName() <<
": Stream source is nullptr";
154 }
155 } else {
156 LOG(WARNING) <<
getName() <<
": Stream while not enabled";
157 }
158 } else {
159 LOG(WARNING) <<
getName() <<
": Stream while shutdown in progress";
160 }
161
163
164 return success;
165 }
◆ 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: