/**
* libcollectdclient - src/libcollectdclient/client.c
- * Copyright (C) 2008-2012 Florian octo Forster
+ * Copyright (C) 2008-2014 Florian octo Forster
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
#include "collectd/lcc_features.h"
+#if WIN32
+
+#include <winsock2.h>
+#include <wspiapi.h>
+#include <windows.h>
+#include <io.h>
+#include <stdio.h>
+#include <math.h>
+#include <assert.h>
+
+#else
+
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <math.h>
#include <netdb.h>
+#endif
+
#include "collectd/client.h"
/* NI_MAXHOST has been obsoleted by RFC 3493 which is a reason for SunOS 5.11
return (status);
} /* }}} int lcc_sendreceive */
+#if !WIN32
static int lcc_open_unixsocket (lcc_connection_t *c, const char *path) /* {{{ */
{
struct sockaddr_un sa;
return (0);
} /* }}} int lcc_open_unixsocket */
+#endif /* !WIN32 */
static int lcc_open_netsocket (lcc_connection_t *c, /* {{{ */
const char *addr_orig)
assert (c->fh == NULL);
assert (addr != NULL);
+#if !WIN32
if (strncmp ("unix:", addr, strlen ("unix:")) == 0)
status = lcc_open_unixsocket (c, addr + strlen ("unix:"));
else if (addr[0] == '/')
status = lcc_open_unixsocket (c, addr);
else
+#endif
status = lcc_open_netsocket (c, addr);
return (status);