aboutsummaryrefslogtreecommitdiffstats
path: root/util/network/poller.h
diff options
context:
space:
mode:
authorAnton Samokhvalov <pg83@yandex.ru>2022-02-10 16:45:17 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:17 +0300
commitd3a398281c6fd1d3672036cb2d63f842d2cb28c5 (patch)
treedd4bd3ca0f36b817e96812825ffaf10d645803f2 /util/network/poller.h
parent72cb13b4aff9bc9cf22e49251bc8fd143f82538f (diff)
downloadydb-d3a398281c6fd1d3672036cb2d63f842d2cb28c5.tar.gz
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 2 of 2.
Diffstat (limited to 'util/network/poller.h')
-rw-r--r--util/network/poller.h92
1 files changed, 46 insertions, 46 deletions
diff --git a/util/network/poller.h b/util/network/poller.h
index 302bb2a78b..8dccd73140 100644
--- a/util/network/poller.h
+++ b/util/network/poller.h
@@ -1,58 +1,58 @@
#pragma once
-#include "socket.h"
-
+#include "socket.h"
+
#include <util/generic/ptr.h>
-#include <util/datetime/base.h>
+#include <util/datetime/base.h>
-class TSocketPoller {
-public:
- TSocketPoller();
+class TSocketPoller {
+public:
+ TSocketPoller();
~TSocketPoller();
-
- void WaitRead(SOCKET sock, void* cookie);
- void WaitWrite(SOCKET sock, void* cookie);
- void WaitReadWrite(SOCKET sock, void* cookie);
+
+ void WaitRead(SOCKET sock, void* cookie);
+ void WaitWrite(SOCKET sock, void* cookie);
+ void WaitReadWrite(SOCKET sock, void* cookie);
void WaitRdhup(SOCKET sock, void* cookie);
-
- void WaitReadOneShot(SOCKET sock, void* cookie);
- void WaitWriteOneShot(SOCKET sock, void* cookie);
- void WaitReadWriteOneShot(SOCKET sock, void* cookie);
+
+ void WaitReadOneShot(SOCKET sock, void* cookie);
+ void WaitWriteOneShot(SOCKET sock, void* cookie);
+ void WaitReadWriteOneShot(SOCKET sock, void* cookie);
void WaitReadWriteEdgeTriggered(SOCKET sock, void* cookie);
void RestartReadWriteEdgeTriggered(SOCKET sock, void* cookie, bool empty = true);
- void Unwait(SOCKET sock);
-
- size_t WaitD(void** events, size_t len, const TInstant& deadLine);
-
- inline size_t WaitT(void** events, size_t len, const TDuration& timeOut) {
- return WaitD(events, len, timeOut.ToDeadLine());
- }
-
- inline size_t WaitI(void** events, size_t len) {
- return WaitD(events, len, TInstant::Max());
- }
-
- inline void* WaitD(const TInstant& deadLine) {
- void* ret;
-
- if (WaitD(&ret, 1, deadLine)) {
- return ret;
- }
-
+ void Unwait(SOCKET sock);
+
+ size_t WaitD(void** events, size_t len, const TInstant& deadLine);
+
+ inline size_t WaitT(void** events, size_t len, const TDuration& timeOut) {
+ return WaitD(events, len, timeOut.ToDeadLine());
+ }
+
+ inline size_t WaitI(void** events, size_t len) {
+ return WaitD(events, len, TInstant::Max());
+ }
+
+ inline void* WaitD(const TInstant& deadLine) {
+ void* ret;
+
+ if (WaitD(&ret, 1, deadLine)) {
+ return ret;
+ }
+
return nullptr;
- }
-
- inline void* WaitT(const TDuration& timeOut) {
- return WaitD(timeOut.ToDeadLine());
- }
-
- inline void* WaitI() {
- return WaitD(TInstant::Max());
- }
-
-private:
- class TImpl;
- THolder<TImpl> Impl_;
+ }
+
+ inline void* WaitT(const TDuration& timeOut) {
+ return WaitD(timeOut.ToDeadLine());
+ }
+
+ inline void* WaitI() {
+ return WaitD(TInstant::Max());
+ }
+
+private:
+ class TImpl;
+ THolder<TImpl> Impl_;
};