MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / ensureConnected

Method ensureConnected

Libraries/Http/HttpAsyncClient.cpp:242–253  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

240 }
241 return Result(true);
242}
243
244bool HttpAsyncClient::canReuseConnectionFor(StringSpan protocol, StringSpan host, uint16_t port) const
245{
246 return hasOpenConnection and currentPort == port and currentProtocol == protocol and currentHost == host;
247}
248
249Result HttpAsyncClient::ensureConnected()
250{
251 if (not hasOpenConnection)
252 {
253 return externalConnector.isValid() ? beginExternalConnection() : beginSocketConnection();
254 }
255 if (canReuseConnectionFor(currentURL.protocol, currentURL.host, currentURL.port))
256 {

Callers

nothing calls this directly

Calls 1

initMethod · 0.45

Tested by

no test coverage detected