aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/netliba/v6/net_test.h
diff options
context:
space:
mode:
authormonster <monster@ydb.tech>2022-07-07 14:41:37 +0300
committermonster <monster@ydb.tech>2022-07-07 14:41:37 +0300
commit06e5c21a835c0e923506c4ff27929f34e00761c2 (patch)
tree75efcbc6854ef9bd476eb8bf00cc5c900da436a2 /library/cpp/netliba/v6/net_test.h
parent03f024c4412e3aa613bb543cf1660176320ba8f4 (diff)
downloadydb-06e5c21a835c0e923506c4ff27929f34e00761c2.tar.gz
fix ya.make
Diffstat (limited to 'library/cpp/netliba/v6/net_test.h')
-rw-r--r--library/cpp/netliba/v6/net_test.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/library/cpp/netliba/v6/net_test.h b/library/cpp/netliba/v6/net_test.h
new file mode 100644
index 0000000000..cfff7409f5
--- /dev/null
+++ b/library/cpp/netliba/v6/net_test.h
@@ -0,0 +1,28 @@
+#pragma once
+
+#include "udp_socket.h"
+
+namespace NNetliba {
+ struct TUdpAddress;
+
+ // needed to limit simultaneous port testers to avoid limit on open handles count
+ extern TAtomic ActivePortTestersCount;
+
+ // need separate socket for each destination
+ // FreeBSD can not return port unreachable error for unconnected socket
+ class TPortUnreachableTester: public TThrRefBase {
+ TNetSocket s;
+ float TimePassed;
+ bool ConnectOk;
+
+ ~TPortUnreachableTester() override;
+
+ public:
+ TPortUnreachableTester();
+ bool IsValid() const {
+ return s.IsValid();
+ }
+ void Connect(const TUdpAddress& addr);
+ bool Test(float deltaT);
+ };
+}