aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/SocketUtil.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2015-02-10 20:30:10 +0100
committerMax Kellermann <max@duempel.org>2015-02-10 22:06:06 +0100
commit4e30e747390ac6bb6a6e5ededfbcdae937579393 (patch)
treebeb2d9acd687a62d476e796114efd8ea6b2f69ad /src/net/SocketUtil.cxx
parent42890b9acf50c4406b61b3b37078c00ec79411fa (diff)
downloadmpd-4e30e747390ac6bb6a6e5ededfbcdae937579393.tar.gz
mpd-4e30e747390ac6bb6a6e5ededfbcdae937579393.tar.xz
mpd-4e30e747390ac6bb6a6e5ededfbcdae937579393.zip
net/SocketAddress: light wrapper for struct sockaddr
Diffstat (limited to 'src/net/SocketUtil.cxx')
-rw-r--r--src/net/SocketUtil.cxx12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/net/SocketUtil.cxx b/src/net/SocketUtil.cxx
index 556a8d037..b2ea63985 100644
--- a/src/net/SocketUtil.cxx
+++ b/src/net/SocketUtil.cxx
@@ -19,25 +19,19 @@
#include "config.h"
#include "SocketUtil.hxx"
+#include "SocketAddress.hxx"
#include "SocketError.hxx"
#include "system/fd_util.h"
#include <unistd.h>
-#ifndef WIN32
-#include <sys/socket.h>
-#else
-#include <ws2tcpip.h>
-#include <winsock.h>
-#endif
-
#ifdef HAVE_IPV6
#include <string.h>
#endif
int
socket_bind_listen(int domain, int type, int protocol,
- const struct sockaddr *address, size_t address_length,
+ SocketAddress address,
int backlog,
Error &error)
{
@@ -60,7 +54,7 @@ socket_bind_listen(int domain, int type, int protocol,
return -1;
}
- ret = bind(fd, address, address_length);
+ ret = bind(fd, address.GetAddress(), address.GetSize());
if (ret < 0) {
SetSocketError(error);
close_socket(fd);