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

Method stop

extensions/sftp/tests/tools/SFTPTestServer.cpp:119–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117}
118
119bool SFTPTestServer::stop() {
120#ifdef WIN32
121 throw std::runtime_error("Not implemented");
122#else
123 if (server_pid_ != -1) {
124 if (::kill(server_pid_, SIGTERM) != 0) {
125 logger_->log_error("Failed to kill child process, error: %s", strerror(errno));
126 return false;
127 }
128 int wstatus;
129 if (::waitpid(server_pid_, &wstatus, 0) == -1) {
130 logger_->log_error("Failed to waitpid for child process, error: %s", strerror(errno));
131 return false;
132 }
133 }
134 if (!port_file_path_.empty()) {
135 logger_->log_debug("Deleting port file %s", port_file_path_.c_str());
136 ::unlink(port_file_path_.c_str());
137 }
138#endif
139 server_pid_ = -1;
140 started_ = false;
141 port_file_path_ = "";
142 return true;
143}
144
145uint16_t SFTPTestServer::getPort() {
146 return port_;

Callers 3

~SFTPTestServerMethod · 0.95
startMethod · 0.95
stopServerMethod · 0.45

Calls 4

log_errorMethod · 0.80
log_debugMethod · 0.80
c_strMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected