From 83cb1b630a3b9da5ca92814de1bac4e7f0bdfb71 Mon Sep 17 00:00:00 2001 From: Angelo Mantellini Date: Fri, 8 Mar 2019 15:35:31 +0100 Subject: [HICN-102] Remove warnings and compilation errors in hicn on windows Change-Id: Ibb5d90fe35097a29fa6edccd3c7859d043888717 Signed-off-by: Angelo Mantellini --- hicn-light/src/io/udpConnection.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'hicn-light') diff --git a/hicn-light/src/io/udpConnection.c b/hicn-light/src/io/udpConnection.c index 3faf2bfac..c3e6d32ac 100644 --- a/hicn-light/src/io/udpConnection.c +++ b/hicn-light/src/io/udpConnection.c @@ -19,8 +19,10 @@ * NB The Send() function may overflow the output buffer * */ -#include +#ifndef _WIN32 +#include +#endif #include #include #include @@ -266,6 +268,7 @@ static bool _sendCommandResponse(IoOperations *ops, struct iovec *message){ parcAssertNotNull(message, "Parameter message must be non-null"); _UdpState *udpConnState = (_UdpState *)ioOperations_GetClosure(ops); +#ifndef _WIN32 // Perform connect before to establish association between this peer and // the remote peer. This is required to use writev. // Connection association can be changed at any time. @@ -283,7 +286,16 @@ static bool _sendCommandResponse(IoOperations *ops, struct iovec *message){ if (writeLength < 0) { return false; } - +#else + ssize_t writeLength = write(udpConnState->udpListenerSocket, message[0].iov_base, (unsigned int)message[0].iov_len); + if (writeLength < 0) { + return false; + } + writeLength = write(udpConnState->udpListenerSocket, message[0].iov_base, (unsigned int)message[0].iov_len); + if (writeLength < 0) { + return false; + } +#endif return true; } -- cgit 1.2.3-korg