aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/coroutine/engine/helper.h
blob: ec2711ba5238e19842fda9f41f9f5d6185865cea (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#pragma once

#include <util/generic/string.h>
#include <util/datetime/base.h>

namespace NCoro {

    // @brief check that address  `host`:`port` is connectable
    bool TryConnect(const TString& host, ui16 port, TDuration timeout = TDuration::Seconds(1));

    // @brief waits until address `host`:`port` became connectable, but not more than timeout
    // @return true on success, false if timeout exceeded
    bool WaitUntilConnectable(const TString& host, ui16 port, TDuration timeout);

}