* Creates a socket and returns a unique ptr * */
| 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 |
no test coverage detected