Skip to content

Commit

Permalink
xio: avoid trying bind to port we know will fail
Browse files Browse the repository at this point in the history
When going over range from port_min to port_max to find open
port to bind we can increase port_min after successful bind so the
next portal will start looking from the next port.

Signed-off-by: Roi Dayan <[email protected]>
  • Loading branch information
roidayan committed Feb 11, 2016
1 parent 1304e94 commit bfafc3b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/msg/xio/XioPortal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ int XioPortals::bind(struct xio_session_ops *ops, const string& base_uri,
// try ports within the configured range
for (; port_min <= port_max; port_min++) {
r = portals[i]->bind(ops, base_uri, port_min, &result_port);
if (r == 0)
if (r == 0) {
port_min++;
break;
}
}
if (r != 0) {
lderr(msgr->cct) << "portal.bind unable to bind to " << base_uri
Expand Down

0 comments on commit bfafc3b

Please sign in to comment.