From 4b0ac1dfa4a03099f59dc07c2d97e06be2bf2651 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 18 Dec 2014 08:33:08 +0000 Subject: Fix socket test on OSX and print error messages. git-svn-id: http://svn.drobilla.net/lad/trunk/raul@5500 a436a847-0d15-0410-975c-d299462d15a1 --- test/socket_test.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/test/socket_test.cpp b/test/socket_test.cpp index 5c7ffae..4547e8b 100644 --- a/test/socket_test.cpp +++ b/test/socket_test.cpp @@ -28,21 +28,25 @@ int main(int argc, char** argv) { Raul::URI unix_uri("unix:///tmp/raul_test_sock"); - Raul::URI tcp_uri("tcp://localhost:12345"); + Raul::URI tcp_uri("tcp://127.0.0.1:12345"); Raul::Socket unix_server_sock(Socket::Type::UNIX); Raul::Socket tcp_server_sock(Socket::Type::TCP); if (!unix_server_sock.bind(unix_uri)) { - fprintf(stderr, "Failed to bind UNIX server socket\n"); + fprintf(stderr, "Failed to bind UNIX server socket (%s)\n", + strerror(errno)); return 1; } else if (!unix_server_sock.listen()) { - fprintf(stderr, "Failed to listen on UNIX server socket\n"); + fprintf(stderr, "Failed to listen on UNIX server socket (%s)\n", + strerror(errno)); return 1; } else if (!tcp_server_sock.bind(tcp_uri)) { - fprintf(stderr, "Failed to bind TCP server socket\n"); + fprintf(stderr, "Failed to bind TCP server socket (%s)\n", + strerror(errno)); return 1; } else if (!tcp_server_sock.listen()) { - fprintf(stderr, "Failed to listen on TCP server socket\n"); + fprintf(stderr, "Failed to listen on TCP server socket (%s)\n", + strerror(errno)); return 1; } -- cgit v1.2.1