/** * @return pretty print of this */ @Override public String toString() { return "" + getBindLocation(); }
public void bind() throws IOException { URI bind = getBindLocation(); String host = bind.getHost(); host = (host == null || host.length() == 0) ? "localhost" : host; InetAddress addr = InetAddress.getByName(host); try { serverSocket = serverSocketFactory.createServerSocket(bind.getPort(), backlog, addr); configureServerSocket(serverSocket); } catch (IOException e) { throw IOExceptionSupport.create("Failed to bind to server socket: " + bind + " due to: " + e, e); } try { setConnectURI(new URI(bind.getScheme(), bind.getUserInfo(), resolveHostName(serverSocket, addr), serverSocket.getLocalPort(), bind.getPath(), bind.getQuery(), bind.getFragment())); } catch (URISyntaxException e) { // it could be that the host name contains invalid characters such // as _ on unix platforms so lets try use the IP address instead try { setConnectURI(new URI(bind.getScheme(), bind.getUserInfo(), addr.getHostAddress(), serverSocket.getLocalPort(), bind.getPath(), bind.getQuery(), bind.getFragment())); } catch (URISyntaxException e2) { throw IOExceptionSupport.create(e2); } } }
/** * @return pretty print of this */ @Override public String toString() { return "" + getBindLocation(); }
/** * @return pretty print of this */ @Override public String toString() { return "" + getBindLocation(); }
/** * @return pretty print of this */ @Override public String toString() { return "" + getBindLocation(); }
/** * @return pretty print of this */ public String toString() { return "" + getBindLocation(); }
public void bind() throws IOException { URI bind = getBindLocation(); String host = bind.getHost(); host = (host == null || host.length() == 0) ? "localhost" : host; InetAddress addr = InetAddress.getByName(host); try { serverSocket = serverSocketFactory.createServerSocket(bind.getPort(), backlog, addr); configureServerSocket(serverSocket); } catch (IOException e) { throw IOExceptionSupport.create("Failed to bind to server socket: " + bind + " due to: " + e, e); } try { setConnectURI(new URI(bind.getScheme(), bind.getUserInfo(), resolveHostName(serverSocket, addr), serverSocket.getLocalPort(), bind.getPath(), bind.getQuery(), bind.getFragment())); } catch (URISyntaxException e) { // it could be that the host name contains invalid characters such // as _ on unix platforms so lets try use the IP address instead try { setConnectURI(new URI(bind.getScheme(), bind.getUserInfo(), addr.getHostAddress(), serverSocket.getLocalPort(), bind.getPath(), bind.getQuery(), bind.getFragment())); } catch (URISyntaxException e2) { throw IOExceptionSupport.create(e2); } } }
public void bind() throws IOException { URI bind = getBindLocation(); String host = bind.getHost(); host = (host == null || host.length() == 0) ? "localhost" : host; InetAddress addr = InetAddress.getByName(host); try { this.serverSocket = serverSocketFactory.createServerSocket(bind.getPort(), backlog, addr); configureServerSocket(this.serverSocket); } catch (IOException e) { throw IOExceptionSupport.create("Failed to bind to server socket: " + bind + " due to: " + e, e); } try { setConnectURI(new URI(bind.getScheme(), bind.getUserInfo(), resolveHostName(serverSocket, addr), serverSocket.getLocalPort(), bind.getPath(), bind.getQuery(), bind .getFragment())); } catch (URISyntaxException e) { // it could be that the host name contains invalid characters such // as _ on unix platforms // so lets try use the IP address instead try { setConnectURI(new URI(bind.getScheme(), bind.getUserInfo(), addr.getHostAddress(), serverSocket.getLocalPort(), bind.getPath(), bind.getQuery(), bind.getFragment())); } catch (URISyntaxException e2) { throw IOExceptionSupport.create(e2); } } }
public void bind() throws IOException { URI bind = getBindLocation(); String host = bind.getHost(); host = (host == null || host.length() == 0) ? "localhost" : host; InetAddress addr = InetAddress.getByName(host); try { serverSocket = serverSocketFactory.createServerSocket(bind.getPort(), backlog, addr); configureServerSocket(serverSocket); } catch (IOException e) { throw IOExceptionSupport.create("Failed to bind to server socket: " + bind + " due to: " + e, e); } try { setConnectURI(new URI(bind.getScheme(), bind.getUserInfo(), resolveHostName(serverSocket, addr), serverSocket.getLocalPort(), bind.getPath(), bind.getQuery(), bind.getFragment())); } catch (URISyntaxException e) { // it could be that the host name contains invalid characters such // as _ on unix platforms so lets try use the IP address instead try { setConnectURI(new URI(bind.getScheme(), bind.getUserInfo(), addr.getHostAddress(), serverSocket.getLocalPort(), bind.getPath(), bind.getQuery(), bind.getFragment())); } catch (URISyntaxException e2) { throw IOExceptionSupport.create(e2); } } }
public void bind() throws IOException { URI bind = getBindLocation(); String host = bind.getHost(); host = (host == null || host.length() == 0) ? "localhost" : host; InetAddress addr = InetAddress.getByName(host); try { serverSocket = serverSocketFactory.createServerSocket(bind.getPort(), backlog, addr); configureServerSocket(serverSocket); } catch (IOException e) { throw IOExceptionSupport.create("Failed to bind to server socket: " + bind + " due to: " + e, e); } try { setConnectURI(new URI(bind.getScheme(), bind.getUserInfo(), resolveHostName(serverSocket, addr), serverSocket.getLocalPort(), bind.getPath(), bind.getQuery(), bind.getFragment())); } catch (URISyntaxException e) { // it could be that the host name contains invalid characters such // as _ on unix platforms so lets try use the IP address instead try { setConnectURI(new URI(bind.getScheme(), bind.getUserInfo(), addr.getHostAddress(), serverSocket.getLocalPort(), bind.getPath(), bind.getQuery(), bind.getFragment())); } catch (URISyntaxException e2) { throw IOExceptionSupport.create(e2); } } }