Browse Source

Merge branch 'thoradia-bind' into dev

Travis LaDuke 4 years ago
parent
commit
27409b615a
1 changed files with 7 additions and 2 deletions
  1. 7 2
      osdep/Binder.hpp

+ 7 - 2
osdep/Binder.hpp

@@ -377,8 +377,13 @@ class Binder {
 #endif
 #endif
 		}
 		}
 		else {
 		else {
-			for (std::vector<InetAddress>::const_iterator i(explicitBind.begin()); i != explicitBind.end(); ++i)
-				localIfAddrs.insert(std::pair<InetAddress, std::string>(*i, std::string()));
+			for (std::vector<InetAddress>::const_iterator i(explicitBind.begin()); i != explicitBind.end(); ++i) {
+				InetAddress ip = InetAddress(*i);
+				for (int x = 0; x < (int)portCount; ++x) {
+					ip.setPort(ports[x]);
+					localIfAddrs.insert(std::pair<InetAddress, std::string>(ip, std::string()));
+				}
+			}
 		}
 		}
 
 
 		// Default to binding to wildcard if we can't enumerate addresses
 		// Default to binding to wildcard if we can't enumerate addresses