Skip to content

Commit

Permalink
Avoid listening on all interfaces by default
Browse files Browse the repository at this point in the history
  • Loading branch information
madjam committed Nov 21, 2017
1 parent bdd4c67 commit 4be817e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/zmq_van.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ class ZMQVan : public Van {
CHECK(receiver_ != NULL)
<< "create receiver socket failed: " << zmq_strerror(errno);
int local = GetEnv("DMLC_LOCAL", 0);
std::string addr = local ? "ipc:///tmp/" : "tcp://*:";
std::string hostname = node.hostname.empty() ? "*" : node.hostname;
std::string addr = local ? "ipc:///tmp/" : "tcp://" + hostname + ":";
int port = node.port;
unsigned seed = static_cast<unsigned>(time(NULL)+port);
for (int i = 0; i < max_retry+1; ++i) {
Expand Down

0 comments on commit 4be817e

Please sign in to comment.