mirror of https://github.com/apache/activemq.git
added a better exception message if we get a binding exception
git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@429765 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
cc5f94d4ed
commit
cab35d7553
|
@ -74,15 +74,19 @@ public class TcpTransportServer extends TransportServerThreadSupport {
|
|||
String host = bind.getHost();
|
||||
host = (host == null || host.length() == 0) ? "localhost" : host;
|
||||
InetAddress addr = InetAddress.getByName(host);
|
||||
|
||||
if (host.trim().equals("localhost") || addr.equals(InetAddress.getLocalHost())) {
|
||||
this.serverSocket = serverSocketFactory.createServerSocket(bind.getPort(), backlog);
|
||||
|
||||
try {
|
||||
if (host.trim().equals("localhost") || addr.equals(InetAddress.getLocalHost())) {
|
||||
this.serverSocket = serverSocketFactory.createServerSocket(bind.getPort(), backlog);
|
||||
}
|
||||
else {
|
||||
this.serverSocket = serverSocketFactory.createServerSocket(bind.getPort(), backlog, addr);
|
||||
}
|
||||
this.serverSocket.setSoTimeout(2000);
|
||||
}
|
||||
else {
|
||||
this.serverSocket = serverSocketFactory.createServerSocket(bind.getPort(), backlog, addr);
|
||||
catch (IOException e) {
|
||||
throw IOExceptionSupport.create("Failed to bind to server socket: " + bind + " due to: " + e, e);
|
||||
}
|
||||
this.serverSocket.setSoTimeout(2000);
|
||||
|
||||
try {
|
||||
setConnectURI(new URI(bind.getScheme(), bind.getUserInfo(), resolveHostName(bind.getHost()), serverSocket.getLocalPort(), bind.getPath(),
|
||||
bind.getQuery(), bind.getFragment()));
|
||||
|
|
Loading…
Reference in New Issue