From 872f1b12b9c4d602d0a2479342bf76c76ecd157f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Fri, 24 Mar 2017 09:04:32 +0100 Subject: [PATCH] For direction of getLocalAddress and getRemoteAddress. --- source/eventcore/drivers/posix/sockets.d | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/eventcore/drivers/posix/sockets.d b/source/eventcore/drivers/posix/sockets.d index 93df6f8..2e416c3 100644 --- a/source/eventcore/drivers/posix/sockets.d +++ b/source/eventcore/drivers/posix/sockets.d @@ -216,7 +216,7 @@ final class PosixEventDriverSockets(Loop : PosixEventLoop) : EventDriverSockets final override bool getLocalAddress(SocketFD sock, scope RefAddress dst) { socklen_t addr_len = dst.nameLen; - if (() @trusted { return getpeername(cast(sock_t)sock, dst.name, &addr_len); } () != 0) + if (() @trusted { return getsockname(cast(sock_t)sock, dst.name, &addr_len); } () != 0) return false; dst.cap(addr_len); return true; @@ -225,7 +225,7 @@ final class PosixEventDriverSockets(Loop : PosixEventLoop) : EventDriverSockets final override bool getRemoteAddress(SocketFD sock, scope RefAddress dst) { socklen_t addr_len = dst.nameLen; - if (() @trusted { return getsockname(cast(sock_t)sock, dst.name, &addr_len); } () != 0) + if (() @trusted { return getpeername(cast(sock_t)sock, dst.name, &addr_len); } () != 0) return false; dst.cap(addr_len); return true;