Skip to content

Commit

Permalink
Merge branch 'adamrankin-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
tokjun committed Oct 15, 2015
2 parents 5a50181 + 8191f88 commit ccb2438
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions Source/igtlClientSocket.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ ClientSocket::~ClientSocket()
}

//-----------------------------------------------------------------------------
int ClientSocket::ConnectToServer(const char* hostName, int port)
int ClientSocket::ConnectToServer(const char* hostName, int port, bool logErrorIfServerConnectionFailed /*= true*/)
{
if (this->m_SocketDescriptor != -1)
{
Expand All @@ -62,7 +62,10 @@ int ClientSocket::ConnectToServer(const char* hostName, int port)
this->CloseSocket(this->m_SocketDescriptor);
this->m_SocketDescriptor = -1;

igtlErrorMacro("Failed to connect to server " << hostName << ":" << port);
if( logErrorIfServerConnectionFailed )
{
igtlErrorMacro("Failed to connect to server " << hostName << ":" << port);
}
return -1;
}
return 0;
Expand Down
2 changes: 1 addition & 1 deletion Source/igtlClientSocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class IGTLCommon_EXPORT ClientSocket : public Socket
igtlNewMacro(igtl::ClientSocket);

/// Connects to host. Returns 0 on success, -1 on error.
int ConnectToServer(const char* hostname, int port);
int ConnectToServer(const char* hostname, int port, bool logErrorIfServerConnectionFailed = true);

protected:
ClientSocket();
Expand Down

0 comments on commit ccb2438

Please sign in to comment.