Skip to content

Commit 81b1995

Browse files
committed
Merge branch 'dev-1.2.1'
2 parents bb28c90 + 36df8fc commit 81b1995

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.14)
22

33
project(absscpi
4-
VERSION 1.2.0
4+
VERSION 1.2.1
55
DESCRIPTION "ABS SCPI driver library"
66
HOMEPAGE_URL "https://github.com/BloomyControls/abs-scpi-driver"
77
)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ In your CMakeLists.txt, fetch and link with the driver:
133133
```cmake
134134
FetchContent_Declare(abs-driver
135135
GIT_REPOSITORY https://github.com/BloomyControls/abs-scpi-driver.git
136-
GIT_TAG v1.2.0
136+
GIT_TAG v1.2.1
137137
GIT_SHALLOW TRUE
138138
)
139139
FetchContent_MakeAvailable(abs-driver)
@@ -145,7 +145,7 @@ If you have already installed the driver to a standard location on your system,
145145
you can use `find_package` instead:
146146

147147
```cmake
148-
find_package(absscpi 1.2.0 REQUIRED)
148+
find_package(absscpi 1.2.1 REQUIRED)
149149
150150
target_link_libraries(my_program PRIVATE bci::absscpi)
151151
```

src/TcpDriver.cpp

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,7 @@ Result<std::string> TcpDriver::ReadLine(unsigned int timeout_ms) const {
6666
}
6767

6868
TcpDriver::Impl::Impl()
69-
: io_context_(),
70-
socket_(io_context_),
71-
input_buffer_() {
72-
boost::system::error_code ignored;
73-
socket_.set_option(boost::asio::socket_base::linger(false, 0), ignored);
74-
socket_.set_option(boost::asio::socket_base::keep_alive(true), ignored);
75-
}
69+
: io_context_(), socket_(io_context_), input_buffer_() {}
7670

7771
TcpDriver::Impl::~Impl() { Close(); }
7872

@@ -99,6 +93,19 @@ ErrorCode TcpDriver::Impl::Connect(std::string_view ip,
9993
return ErrorCode::kConnectionFailed;
10094
}
10195

96+
socket_.set_option(boost::asio::socket_base::linger(false, 0), ec);
97+
socket_.set_option(boost::asio::socket_base::keep_alive(true), ec);
98+
socket_.set_option(
99+
boost::asio::detail::socket_option::integer<IPPROTO_TCP, TCP_KEEPIDLE>(1),
100+
ec);
101+
socket_.set_option(
102+
boost::asio::detail::socket_option::integer<IPPROTO_TCP, TCP_KEEPINTVL>(
103+
1),
104+
ec);
105+
socket_.set_option(
106+
boost::asio::detail::socket_option::integer<IPPROTO_TCP, TCP_KEEPCNT>(5),
107+
ec);
108+
102109
return ErrorCode::kSuccess;
103110
}
104111

0 commit comments

Comments
 (0)