Skip to content

Commit

Permalink
Update Modbus_TCP_Client_poll.cpp
Browse files Browse the repository at this point in the history
fix syscall optval size
  • Loading branch information
NikolasK-source authored May 9, 2024
1 parent 4bc49c8 commit c9f4ae9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Modbus_TCP_Client_poll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ Client_Poll::~Client_Poll() {
void Client_Poll::set_tcp_timeout(std::size_t tcp_timeout) const {
// set user timeout (~= timeout for tcp connection)
unsigned user_timeout = static_cast<unsigned>(tcp_timeout) * 1000; // NOLINT
int tmp = setsockopt(server_socket, IPPROTO_TCP, TCP_USER_TIMEOUT, &user_timeout, sizeof(tcp_timeout));
int tmp = setsockopt(server_socket, IPPROTO_TCP, TCP_USER_TIMEOUT, &user_timeout, sizeof(user_timeout));
if (tmp != 0) {
throw std::system_error(errno, std::generic_category(), "Failed to set socket option TCP_USER_TIMEOUT");
}
Expand Down

0 comments on commit c9f4ae9

Please sign in to comment.