MCPcopy Create free account
hub / github.com/apache/nifi-minifi-cpp / close

Method close

libminifi/src/io/ClientSocket.cpp:224–242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

222}
223
224void Socket::close() {
225 if (valid_socket(socket_file_descriptor_)) {
226 logging::LOG_DEBUG(logger_) << "Closing " << socket_file_descriptor_;
227#ifdef WIN32
228 closesocket(socket_file_descriptor_);
229#else
230 ::close(socket_file_descriptor_);
231#endif
232 socket_file_descriptor_ = INVALID_SOCKET;
233 }
234 if (total_written_ > 0) {
235 local_network_interface_.log_write(gsl::narrow<uint32_t>(total_written_.load()));
236 total_written_ = 0;
237 }
238 if (total_read_ > 0) {
239 local_network_interface_.log_read(gsl::narrow<uint32_t>(total_read_.load()));
240 total_read_ = 0;
241 }
242}
243
244void Socket::setNonBlocking() {
245 if (listeners_ <= 0) {

Callers

nothing calls this directly

Calls 5

valid_socketFunction · 0.85
closeFunction · 0.85
log_writeMethod · 0.80
log_readMethod · 0.80
loadMethod · 0.45

Tested by

no test coverage detected