| 327 | .addListener<HttpAsyncClient, &HttpAsyncClient::onReconnectSocketWritableClosed>(*this); |
| 328 | if (not added) |
| 329 | { |
| 330 | clearReconnectCloseListeners(); |
| 331 | return Result::Error("HttpAsyncClient reconnect socket writable close listener unavailable"); |
| 332 | } |
| 333 | reconnectClosuresPending++; |
| 334 | } |
| 335 | |
| 336 | closeConnection(true); |
| 337 | reconnectCloseInProgress = false; |
| 338 | return continueReconnectAfterClose(); |
| 339 | } |
| 340 | |
| 341 | void HttpAsyncClient::onReconnectTransportShutdown(Result result) |
| 342 | { |
| 343 | if (not reconnectPending) |
| 344 | { |
| 345 | return; |
| 346 | } |
| 347 | if (not result) |
| 348 | { |
| 349 | fail(result); |
| 350 | return; |
| 351 | } |
| 352 | |
| 353 | Result closeResult = beginReconnectClose(); |
| 354 | if (not closeResult) |
| 355 | { |
| 356 | fail(closeResult); |
| 357 | } |
| 358 | } |
| 359 | |
| 360 | Result HttpAsyncClient::continueReconnectAfterClose() |
| 361 | { |
| 362 | if (not reconnectPending or reconnectClosuresPending != 0) |
| 363 | { |
| 364 | return Result(true); |
| 365 | } |
| 366 | reconnectPending = false; |
| 367 | reconnectReadableStream = nullptr; |
| 368 | reconnectWritableStream = nullptr; |
| 369 | reconnectSocketReadableStream = nullptr; |
| 370 | reconnectSocketWritableStream = nullptr; |
| 371 | return externalConnector.isValid() ? beginExternalConnection() : beginSocketConnection(); |
| 372 | } |
| 373 | |
| 374 | void HttpAsyncClient::clearReconnectCloseListeners() |
| 375 | { |
| 376 | if (reconnectReadableStream != nullptr) |
| 377 | { |
| 378 | (void)reconnectReadableStream->eventClose |
| 379 | .removeListener<HttpAsyncClient, &HttpAsyncClient::onReconnectReadableClosed>(*this); |
| 380 | } |
nothing calls this directly
no outgoing calls
no test coverage detected