Skip to content

Commit ca94ccd

Browse files
author
Artiom N.
committed
Book 02 restructuring
1 parent ca23baf commit ca94ccd

File tree

88 files changed

+42
-54
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+42
-54
lines changed

src/book02/ch03/cpp/mt_server/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ extern "C"
3333
#endif
3434

3535

36-
const auto clients_count = 10;
37-
const auto buffer_size = 4096;
36+
constexpr auto clients_count = 10;
37+
constexpr auto buffer_size = 4096;
3838
using namespace std::literals;
3939
namespace fs = std::filesystem;
4040

@@ -126,7 +126,7 @@ class Transceiver
126126
if (size <= recv_bytes) break;
127127
}
128128

129-
buffer[recv_bytes] = '\0';
129+
buffer[std::min(size, recv_bytes)] = '\0';
130130

131131
auto result = std::string(buffer.begin(), buffer.begin() + recv_bytes);
132132
std::cout << "Request = \"" << result << "\"" << std::endl;

src/book02/ch04/cpp/CMakeLists.txt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
cmake_minimum_required(VERSION 3.10)
22

3-
add_subdirectory("reuse_addr_test")
4-
add_subdirectory("reuse_addr_experiment")
5-
63
if (UNIX)
7-
# if (LINUX)
8-
add_subdirectory("tcp_congestion_control")
9-
# endif()
4+
add_subdirectory("select_aio_server")
105
endif()

src/book02/ch07/cpp/select_aio_server/CMakeLists.txt renamed to src/book02/ch04/cpp/select_aio_server/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,3 @@ target_link_libraries("${PROJECT_NAME}" socket-wrapper)
1212
if(WIN32)
1313
target_link_libraries("${PROJECT_NAME}" wsock32 ws2_32)
1414
endif()
15-
File renamed without changes.

src/book02/ch05/cpp/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
cmake_minimum_required(VERSION 3.10)
22

33
if (UNIX)
4-
add_subdirectory("scatter_gatter")
4+
add_subdirectory("epoll_example")
5+
add_subdirectory("aio_example")
6+
add_subdirectory("ioring_server")
57
endif()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)