To connect to the metaserver, try on all interfaces unless one was passed on the commandline
This commit is contained in:
parent
39aa96fb62
commit
c9c4bc3731
1 changed files with 7 additions and 1 deletions
|
@ -97,7 +97,13 @@ int CMetaClient::Init()
|
|||
// Server socket
|
||||
CHost metaServerHost(metaHost.c_str(), metaPort);
|
||||
// Client socket
|
||||
CHost metaClientHost(CNetworkParameter::Instance.localHost.c_str(), CNetworkParameter::Instance.localPort);
|
||||
|
||||
// open on all interfaces, not the loopback, unless we have an override from the commandline
|
||||
std::string localHost = CNetworkParameter::Instance.localHost;
|
||||
if (!localHost.compare("127.0.0.1")) {
|
||||
localHost = "0.0.0.0";
|
||||
}
|
||||
CHost metaClientHost(localHost.c_str(), CNetworkParameter::Instance.localPort);
|
||||
metaSocket.Open(metaClientHost);
|
||||
if (metaSocket.IsValid() == false) {
|
||||
fprintf(stderr, "METACLIENT: No free port %d available, aborting\n", metaServerHost.getPort());
|
||||
|
|
Loading…
Reference in a new issue