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

Method createSocket

libminifi/include/io/StreamFactory.h:55–67  ·  view source on GitHub ↗

* Creates a socket and returns a unique ptr * */

Source from the content-addressed store, hash-verified

53 *
54 */
55 std::unique_ptr<Socket> createSocket(const std::string &host, const uint16_t port, uint32_t estimated_size = 0) {
56 auto socket = delegate_->createSocket(host, port);
57 auto prioritizer_ = NetworkPrioritizerFactory::getInstance()->getPrioritizer();
58 if (nullptr != prioritizer_) {
59 auto &&ifc = prioritizer_->getInterface(estimated_size);
60 if (ifc.getInterface().empty()) {
61 return nullptr;
62 } else {
63 socket->setInterface(std::move(ifc));
64 }
65 }
66 return socket;
67 }
68
69 /**
70 * Creates a socket and returns a unique ptr

Callers 1

createStreamingPeerFunction · 0.45

Calls 4

getPrioritizerMethod · 0.80
getInterfaceMethod · 0.45
emptyMethod · 0.45
setInterfaceMethod · 0.45

Tested by

no test coverage detected