UniSet 2.32.1
TCPCheck.h
1/*
2 * Copyright (c) 2015 Pavel Vainerman.
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as
6 * published by the Free Software Foundation, version 2.1.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Lesser Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16// -----------------------------------------------------------------------------
17#ifndef TCPCheck_H_
18#define TCPCheck_H_
19// -----------------------------------------------------------------------------
20#include <atomic>
21#include "ThreadCreator.h"
22#include "PassiveTimer.h" // for timeout_t
23// -----------------------------------------------------------------------------
24namespace uniset
25{
32 {
33 public:
34
43 static bool check( const std::string& _ip, int _port, timeout_t tout ) noexcept;
44
46 static bool check( const std::string& iaddr, timeout_t tout ) noexcept;
47
48
53 static bool ping( const std::string& _ip, timeout_t tout = 1100, const std::string& ping_argc = "-c 1 -w 1 -q -n" ) noexcept;
54 };
55 // -------------------------------------------------------------------------
56} // end of uniset namespace
57// -----------------------------------------------------------------------------
58#endif // TCPCheck_H_
59// -----------------------------------------------------------------------------
Definition TCPCheck.h:32
static bool check(const std::string &_ip, int _port, timeout_t tout) noexcept
Definition TCPCheck.cc:40
static bool ping(const std::string &_ip, timeout_t tout=1100, const std::string &ping_argc="-c 1 -w 1 -q -n") noexcept
Definition TCPCheck.cc:83
Definition Calibration.h:27