Skip to content

Commit cdaaa10

Browse files
committed
Cast socket::recv arguments only for windows
1 parent 1c34f75 commit cdaaa10

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/comm/tcp_socket.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,11 @@ bool TCPSocket::read(uint8_t* buf, const size_t buf_len, size_t& read)
191191
if (state_ != SocketState::Connected)
192192
return false;
193193

194+
#ifdef _WIN32
194195
ssize_t res = ::recv(socket_fd_, reinterpret_cast<char*>(buf), static_cast<const socklen_t>(buf_len), 0);
196+
#else
197+
ssize_t res = ::recv(socket_fd_, buf, buf_len, 0);
198+
#endif
195199

196200
if (res == 0)
197201
{

0 commit comments

Comments
 (0)