summaryrefslogtreecommitdiffstats
path: root/hicn-light/src/io
diff options
context:
space:
mode:
authorAngelo Mantellini <manangel@cisco.com>2019-03-08 15:35:31 +0100
committerAngelo Mantellini <manangel@cisco.com>2019-03-08 15:46:13 +0100
commit83cb1b630a3b9da5ca92814de1bac4e7f0bdfb71 (patch)
tree767a67667da286cc414d9b7099fd5b524dce40e7 /hicn-light/src/io
parent6aaef596f68a514036d5212fc8697bdaf371e5af (diff)
[HICN-102] Remove warnings and compilation errors in hicn on windows
Change-Id: Ibb5d90fe35097a29fa6edccd3c7859d043888717 Signed-off-by: Angelo Mantellini <manangel@cisco.com>
Diffstat (limited to 'hicn-light/src/io')
-rw-r--r--hicn-light/src/io/udpConnection.c16
1 files changed, 14 insertions, 2 deletions
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 <sys/uio.h>
+#ifndef _WIN32
+#include <sys/uio.h>
+#endif
#include <errno.h>
#include <src/config.h>
#include <stdio.h>
@@ -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;
}