From dfb372312860b7ef0fbdadde61ea663036acf026 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?llu=C3=ADs=20g=C3=B3mez=20i=20bigord=C3=A0?= Date: Mon, 14 Feb 2011 21:02:43 +0000 Subject: in macosx a unix socket connection must be to lo address 127.0.0.1, localhost seems to make some confusion svn path=/trunk/externals/pdvjtools/; revision=14920 --- pix_preview/pix_preview.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pix_preview/pix_preview.cc b/pix_preview/pix_preview.cc index 82ab427..aee73c4 100644 --- a/pix_preview/pix_preview.cc +++ b/pix_preview/pix_preview.cc @@ -184,11 +184,16 @@ void pix_preview :: connectMess() std::string str; str = ostr.str(); - getaddrinfo("localhost", reinterpret_cast(str.c_str()), &hints, &res); + getaddrinfo("127.0.0.1", reinterpret_cast(str.c_str()), &hints, &res); fprintf(stderr,"trying to connect...\n"); + s = socket(res->ai_family, res->ai_socktype, 0); - connect(s, res->ai_addr, res->ai_addrlen); + + if( connect(s, res->ai_addr, res->ai_addrlen) != 0) + fprintf(stderr,"ERROR socket connection "); + else + fprintf(stderr,"socket connection ok"); } void pix_preview :: processImage(imageStruct &image) -- cgit v1.2.1