From e1dbbf7e8e0b2d5101aa4e06d90f82cfab5087d2 Mon Sep 17 00:00:00 2001 From: Mauro Sardara Date: Mon, 11 Mar 2019 19:19:15 +0100 Subject: [HICN-106] Added generation of .lib for dll shared libraries fixed warning for shift in csum_fold function in libhicn added declaration of external symbol in libtransport log. Change-Id: I9377eb6016a74f14eb8f05df2ced36ee41a27bfd Signed-off-by: Mauro Sardara --- hicn-light/src/io/udpConnection.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'hicn-light/src/io') diff --git a/hicn-light/src/io/udpConnection.c b/hicn-light/src/io/udpConnection.c index c3e6d32ac..5fbdf4998 100644 --- a/hicn-light/src/io/udpConnection.c +++ b/hicn-light/src/io/udpConnection.c @@ -287,13 +287,20 @@ static bool _sendCommandResponse(IoOperations *ops, struct iovec *message){ return false; } #else - ssize_t writeLength = write(udpConnState->udpListenerSocket, message[0].iov_base, (unsigned int)message[0].iov_len); - if (writeLength < 0) { - return false; + WSABUF dataBuf[2]; + DWORD BytesSent = 0; + + for (int i = 0; i < 2; i++) { + dataBuf[i].buf = message[i].iov_base; + dataBuf[i].len = (ULONG)message[i].iov_len; } - writeLength = write(udpConnState->udpListenerSocket, message[0].iov_base, (unsigned int)message[0].iov_len); - if (writeLength < 0) { - return false; + + int rc = WSASendTo(udpConnState->udpListenerSocket, dataBuf, 2, + &BytesSent, 0, (SOCKADDR *)udpConnState->peerAddress, + udpConnState->peerAddressLength, NULL, NULL); + + if (rc == SOCKET_ERROR) { + return false; } #endif return true; -- cgit 1.2.3-korg