From 64dcbcaf4eb2bdbd057cdd18908c3639def8656a Mon Sep 17 00:00:00 2001 From: sletz Date: Sun, 6 Nov 2011 09:11:40 +0000 Subject: [PATCH] Enable local access in NetJack2 code. git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4568 0c269be4-1314-0410-8aa9-9f06e86f4224 --- ChangeLog | 4 ++++ common/JackNetInterface.cpp | 12 ++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 35498a3e..eff64462 100644 --- a/ChangeLog +++ b/ChangeLog @@ -36,6 +36,10 @@ John Emmas Jackdmp changes log --------------------------- +2011-11-06 Stephane Letz + + * Enable local access in NetJack2 code. + 2011-11-04 Stephane Letz * Fix jack_set_port_name API. diff --git a/common/JackNetInterface.cpp b/common/JackNetInterface.cpp index 32e2ed2f..55ce0be5 100644 --- a/common/JackNetInterface.cpp +++ b/common/JackNetInterface.cpp @@ -713,10 +713,14 @@ namespace Jack return NET_SOCKET_ERROR; } - // bind the socket - if (fSocket.Bind() == SOCKET_ERROR) { - jack_error("Can't bind the socket : %s", StrError(NET_ERROR_CODE)); - return NET_SOCKET_ERROR; + if (fSocket.IsLocal(fMulticastIP)) { + jack_info("Local IP is used..."); + } else { + // bind the socket + if (fSocket.Bind() == SOCKET_ERROR) { + jack_error("Can't bind the socket : %s", StrError(NET_ERROR_CODE)); + return NET_SOCKET_ERROR; + } } // timeout on receive