Use WSASendTo instead of WSASend

Because we're using unconnected sockets, the destination must be
defined explicitly
This commit is contained in:
Aaro Altonen 2019-07-16 11:37:17 +03:00
parent ec8619864e
commit b919574be9
1 changed files with 1 additions and 1 deletions

View File

@ -133,7 +133,7 @@ rtp_error_t kvz_rtp::socket::__sendto(sockaddr_in& addr, uint8_t *buf, size_t bu
data_buf.buf = (char *)buf;
data_buf.len = buf_len;
if (WSASend(socket_, &data_buf, 1, &sent_bytes, flags, NULL, NULL) == -1) {
if (WSASendTo(socket_, &data_buf, 1, &sent_bytes, flags, (const struct sockaddr *)&addr, sizeof(addr_), NULL, NULL) == -1) {
/* TODO: winsock specific error message */
LOG_ERROR("Failed to send data!");