Skip to content

Commit 75a541d

Browse files
Merge pull request #40 from SHMModbus/main
Update Modbus_TCP_Client_poll.cpp
2 parents 9f9f0c9 + c9f4ae9 commit 75a541d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Modbus_TCP_Client_poll.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ Client_Poll::~Client_Poll() {
158158
void Client_Poll::set_tcp_timeout(std::size_t tcp_timeout) const {
159159
// set user timeout (~= timeout for tcp connection)
160160
unsigned user_timeout = static_cast<unsigned>(tcp_timeout) * 1000; // NOLINT
161-
int tmp = setsockopt(server_socket, IPPROTO_TCP, TCP_USER_TIMEOUT, &user_timeout, sizeof(tcp_timeout));
161+
int tmp = setsockopt(server_socket, IPPROTO_TCP, TCP_USER_TIMEOUT, &user_timeout, sizeof(user_timeout));
162162
if (tmp != 0) {
163163
throw std::system_error(errno, std::generic_category(), "Failed to set socket option TCP_USER_TIMEOUT");
164164
}

0 commit comments

Comments
 (0)