aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/coroutine/engine/helper.h
blob: 0c3e978699e2cdc474b09908f2d8c53d6fdf4fda (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); 
 
}