Skip to content

Commit

Permalink
fix compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyangzi committed Feb 4, 2016
1 parent 757477b commit 593951b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions samples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ project(samples)
if (WIN32)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
else ()
set(CMAKE_CXX_FLAGS "-std=c++11 -g -Wall")
endif()

include(${PROJECT_SOURCE_DIR}/../boost.cmake)
Expand Down
7 changes: 5 additions & 2 deletions samples/sample3_echo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ void echo_server()
} else {
// echo
// 阻塞的write已被HOOK,等待期间切换执行其他协程。
write(sockfd, buf, n);
ssize_t wn = write(sockfd, buf, n);
(void)wn;

}
}

Expand All @@ -77,7 +79,8 @@ void client()
char buf[12] = "1234";
int len = strlen(buf) + 1;
// 阻塞的write已被HOOK,等待期间切换执行其他协程。
write(sockfd, buf, len);
ssize_t wn = write(sockfd, buf, len);
(void)wn;
printf("send [%d] %s\n", len, buf);

char rcv_buf[12];
Expand Down

0 comments on commit 593951b

Please sign in to comment.