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

Method reconnect

extensions/opc/src/opcbase.cpp:132–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130 }
131
132 bool BaseOPCProcessor::reconnect() {
133 if (connection_ == nullptr) {
134 connection_ = opc::Client::createClient(logger_, applicationURI_, certBuffer_, keyBuffer_, trustBuffers_);
135 }
136
137 if (connection_->isConnected()) {
138 return true;
139 }
140
141 auto sc = connection_->connect(endPointURL_, username_, password_);
142 if (sc != UA_STATUSCODE_GOOD) {
143 logger_->log_error("Failed to connect: %s!", UA_StatusCode_name(sc));
144 return false;
145 }
146 logger_->log_debug("Successfully connected.");
147 return true;
148 }
149
150} /* namespace processors */
151} /* namespace minifi */

Callers

nothing calls this directly

Calls 5

isConnectedMethod · 0.80
log_errorMethod · 0.80
log_debugMethod · 0.80
createClientFunction · 0.50
connectMethod · 0.45

Tested by

no test coverage detected