diff options
author | Alexander Smirnov <alex@ydb.tech> | 2024-11-20 11:14:58 +0000 |
---|---|---|
committer | Alexander Smirnov <alex@ydb.tech> | 2024-11-20 11:14:58 +0000 |
commit | 31773f157bf8164364649b5f470f52dece0a4317 (patch) | |
tree | 33d0f7eef45303ab68cf08ab381ce5e5e36c5240 /util/network/pair.cpp | |
parent | 2c7938962d8689e175574fc1e817c05049f27905 (diff) | |
parent | eff600952d5dfe17942f38f510a8ac2b203bb3a5 (diff) | |
download | ydb-31773f157bf8164364649b5f470f52dece0a4317.tar.gz |
Merge branch 'rightlib' into mergelibs-241120-1113
Diffstat (limited to 'util/network/pair.cpp')
-rw-r--r-- | util/network/pair.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/util/network/pair.cpp b/util/network/pair.cpp index 9751ef5c96..de07d5f35c 100644 --- a/util/network/pair.cpp +++ b/util/network/pair.cpp @@ -47,17 +47,21 @@ int SocketPair(SOCKET socks[2], bool overlapped, bool cloexec) { } do { - if (listen(listener, 1) == SOCKET_ERROR) + if (listen(listener, 1) == SOCKET_ERROR) { break; + } - if ((socks[0] = WSASocket(AF_INET, SOCK_STREAM, 0, nullptr, 0, flags)) == INVALID_SOCKET) + if ((socks[0] = WSASocket(AF_INET, SOCK_STREAM, 0, nullptr, 0, flags)) == INVALID_SOCKET) { break; + } - if (connect(socks[0], (const struct sockaddr*)&addr, sizeof(addr)) == SOCKET_ERROR) + if (connect(socks[0], (const struct sockaddr*)&addr, sizeof(addr)) == SOCKET_ERROR) { break; + } - if ((socks[1] = accept(listener, nullptr, nullptr)) == INVALID_SOCKET) + if ((socks[1] = accept(listener, nullptr, nullptr)) == INVALID_SOCKET) { break; + } closesocket(listener); |