From e392f3ca2f70a86a02542e7c57a3f3fa270afe04 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Thu, 1 Apr 2010 07:50:15 +0000 Subject: [PATCH] Changed posix to use all IP addresses for LAN auto connect --- source/shared_lib/sources/platform/posix/socket.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/source/shared_lib/sources/platform/posix/socket.cpp b/source/shared_lib/sources/platform/posix/socket.cpp index aa818ebba..0e097ffb6 100644 --- a/source/shared_lib/sources/platform/posix/socket.cpp +++ b/source/shared_lib/sources/platform/posix/socket.cpp @@ -752,7 +752,9 @@ std::vector ClientSocket::discoverServers() { vector tokens; Tokenize(buff,tokens,":"); - foundServers.push_back(tokens[1]); + for(int idx = 1; idx < tokens.size(); idx++) { + foundServers.push_back(tokens[idx]); + } break; } } @@ -1036,9 +1038,9 @@ void BroadCastSocketThread::execute() { try { // Send this machine's host name and address in hostname:n.n.n.n format - strcat(buff,myhostname); - for(int idx = 0; idx < ipList.size() ++idx) { - sprintf(buff,"%s:%s",buf,ipList[idx].c_str()); + sprintf(buff,"%s",myhostname); + for(int idx = 0; idx < ipList.size(); idx++) { + sprintf(buff,"%s:%s",buff,ipList[idx].c_str()); } time_t elapsed = 0;