diff options
author | monster <monster@ydb.tech> | 2022-07-07 14:41:37 +0300 |
---|---|---|
committer | monster <monster@ydb.tech> | 2022-07-07 14:41:37 +0300 |
commit | 06e5c21a835c0e923506c4ff27929f34e00761c2 (patch) | |
tree | 75efcbc6854ef9bd476eb8bf00cc5c900da436a2 /library/cpp/neh/tcp2.h | |
parent | 03f024c4412e3aa613bb543cf1660176320ba8f4 (diff) | |
download | ydb-06e5c21a835c0e923506c4ff27929f34e00761c2.tar.gz |
fix ya.make
Diffstat (limited to 'library/cpp/neh/tcp2.h')
-rw-r--r-- | library/cpp/neh/tcp2.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/library/cpp/neh/tcp2.h b/library/cpp/neh/tcp2.h new file mode 100644 index 0000000000..bd6d8c25bd --- /dev/null +++ b/library/cpp/neh/tcp2.h @@ -0,0 +1,44 @@ +#pragma once + +#include <util/datetime/base.h> +#include <util/system/defaults.h> + +namespace NNeh { + //global options + struct TTcp2Options { + //connect timeout + static TDuration ConnectTimeout; + + //input buffer size + static size_t InputBufferSize; + + //asio client threads + static size_t AsioClientThreads; + + //asio server threads, - if == 0, use acceptor thread for read/parse incoming requests + //esle use one thread for accepting + AsioServerThreads for process established tcp connections + static size_t AsioServerThreads; + + //listen socket queue limit + static int Backlog; + + //try call non block write to socket from client thread (for decrease latency) + static bool ClientUseDirectWrite; + + //try call non block write to socket from client thread (for decrease latency) + static bool ServerUseDirectWrite; + + //expecting receiving request data right after connect or inside receiving request data + static TDuration ServerInputDeadline; + + //timelimit for sending response data + static TDuration ServerOutputDeadline; + + //set option, - return false, if option name not recognized + static bool Set(TStringBuf name, TStringBuf value); + }; + + class IProtocol; + + IProtocol* Tcp2Protocol(); +} |