@Override protected void bind(InetAddress address, int port) throws IOException { IoBridge.bind(fd, address, port); this.address = address; if (port != 0) { this.localport = port; } else { this.localport = IoBridge.getSocketLocalPort(fd); } }
@Override public void bind(int port, InetAddress address) throws SocketException { IoBridge.bind(fd, address, port); if (port != 0) { localPort = port; } else { localPort = IoBridge.getSocketLocalPort(fd); } try { setOption(SocketOptions.SO_BROADCAST, Boolean.TRUE); } catch (IOException ignored) { } }
private boolean isReachable(InetAddress destination, InetAddress source, int timeout) throws IOException { // TODO: try ICMP first (http://code.google.com/p/android/issues/detail?id=20106) FileDescriptor fd = IoBridge.socket(true); boolean reached = false; try { if (source != null) { IoBridge.bind(fd, source, 0); } IoBridge.connect(fd, destination, 7, timeout); reached = true; } catch (IOException e) { if (e.getCause() instanceof ErrnoException) { // "Connection refused" means the IP address was reachable. reached = (((ErrnoException) e.getCause()).errno == ECONNREFUSED); } } IoBridge.closeSocket(fd); return reached; }
@Override protected void bind(InetAddress address, int port) throws IOException { IoBridge.bind(fd, address, port); this.address = address; if (port != 0) { this.localport = port; } else { this.localport = IoBridge.getSocketLocalPort(fd); } }
@Override protected void bind(InetAddress address, int port) throws IOException { IoBridge.bind(fd, address, port); this.address = address; if (port != 0) { this.localport = port; } else { this.localport = IoBridge.getSocketLocalPort(fd); } }
@Override protected void bind(InetAddress address, int port) throws IOException { IoBridge.bind(fd, address, port); this.address = address; if (port != 0) { this.localport = port; } else { this.localport = IoBridge.getSocketLocalPort(fd); } }
@Override protected void bind(InetAddress address, int port) throws IOException { IoBridge.bind(fd, address, port); this.address = address; if (port != 0) { this.localport = port; } else { this.localport = IoBridge.getSocketLocalPort(fd); } }
@Override protected void bind(InetAddress address, int port) throws IOException { IoBridge.bind(fd, address, port); this.address = address; if (port != 0) { this.localport = port; } else { this.localport = IoBridge.getSocketLocalPort(fd); } }
@Override protected void bind(InetAddress address, int port) throws IOException { IoBridge.bind(fd, address, port); this.address = address; if (port != 0) { this.localport = port; } else { this.localport = IoBridge.getSocketLocalPort(fd); } }
@Override public void bind(int port, InetAddress address) throws SocketException { IoBridge.bind(fd, address, port); if (port != 0) { localPort = port; } else { localPort = IoBridge.getSocketLocalPort(fd); } try { setOption(SocketOptions.SO_BROADCAST, Boolean.TRUE); } catch (IOException ignored) { } }
@Override public void bind(int port, InetAddress address) throws SocketException { IoBridge.bind(fd, address, port); if (port != 0) { localPort = port; } else { localPort = IoBridge.getSocketLocalPort(fd); } try { setOption(SocketOptions.SO_BROADCAST, Boolean.TRUE); } catch (IOException ignored) { } }
@Override public void bind(int port, InetAddress address) throws SocketException { IoBridge.bind(fd, address, port); if (port != 0) { localPort = port; } else { localPort = IoBridge.getSocketLocalPort(fd); } try { setOption(SocketOptions.SO_BROADCAST, Boolean.TRUE); } catch (IOException ignored) { } }
@Override public void bind(int port, InetAddress address) throws SocketException { IoBridge.bind(fd, address, port); if (port != 0) { localPort = port; } else { localPort = IoBridge.getSocketLocalPort(fd); } try { setOption(SocketOptions.SO_BROADCAST, Boolean.TRUE); } catch (IOException ignored) { } }
@Override public void bind(int port, InetAddress address) throws SocketException { IoBridge.bind(fd, address, port); if (port != 0) { localPort = port; } else { localPort = IoBridge.getSocketLocalPort(fd); } try { setOption(SocketOptions.SO_BROADCAST, Boolean.TRUE); } catch (IOException ignored) { } }
@Override public void bind(int port, InetAddress address) throws SocketException { IoBridge.bind(fd, address, port); if (port != 0) { localPort = port; } else { localPort = IoBridge.getSocketLocalPort(fd); } try { setOption(SocketOptions.SO_BROADCAST, Boolean.TRUE); } catch (IOException ignored) { } }
private boolean isReachable(InetAddress destination, InetAddress source, int timeout) throws IOException { // TODO: try ICMP first (http://code.google.com/p/android/issues/detail?id=20106) FileDescriptor fd = IoBridge.socket(true); boolean reached = false; try { if (source != null) { IoBridge.bind(fd, source, 0); } IoBridge.connect(fd, destination, 7, timeout); reached = true; } catch (IOException e) { if (e.getCause() instanceof ErrnoException) { // "Connection refused" means the IP address was reachable. reached = (((ErrnoException) e.getCause()).errno == ECONNREFUSED); } } IoBridge.closeSocket(fd); return reached; }
private boolean isReachable(InetAddress destination, InetAddress source, int timeout) throws IOException { // TODO: try ICMP first (http://code.google.com/p/android/issues/detail?id=20106) FileDescriptor fd = IoBridge.socket(true); boolean reached = false; try { if (source != null) { IoBridge.bind(fd, source, 0); } IoBridge.connect(fd, destination, 7, timeout); reached = true; } catch (IOException e) { if (e.getCause() instanceof ErrnoException) { // "Connection refused" means the IP address was reachable. reached = (((ErrnoException) e.getCause()).errno == ECONNREFUSED); } } IoBridge.closeSocket(fd); return reached; }
private boolean isReachable(InetAddress destination, InetAddress source, int timeout) throws IOException { // TODO: try ICMP first (http://code.google.com/p/android/issues/detail?id=20106) FileDescriptor fd = IoBridge.socket(true); boolean reached = false; try { if (source != null) { IoBridge.bind(fd, source, 0); } IoBridge.connect(fd, destination, 7, timeout); reached = true; } catch (IOException e) { if (e.getCause() instanceof ErrnoException) { // "Connection refused" means the IP address was reachable. reached = (((ErrnoException) e.getCause()).errno == ECONNREFUSED); } } IoBridge.closeSocket(fd); return reached; }
private boolean isReachable(InetAddress destination, InetAddress source, int timeout) throws IOException { // TODO: try ICMP first (http://code.google.com/p/android/issues/detail?id=20106) FileDescriptor fd = IoBridge.socket(true); boolean reached = false; try { if (source != null) { IoBridge.bind(fd, source, 0); } IoBridge.connect(fd, destination, 7, timeout); reached = true; } catch (IOException e) { if (e.getCause() instanceof ErrnoException) { // "Connection refused" means the IP address was reachable. reached = (((ErrnoException) e.getCause()).errno == ECONNREFUSED); } } IoBridge.closeSocket(fd); return reached; }
private boolean isReachable(InetAddress destination, InetAddress source, int timeout) throws IOException { // TODO: try ICMP first (http://code.google.com/p/android/issues/detail?id=20106) FileDescriptor fd = IoBridge.socket(true); boolean reached = false; try { if (source != null) { IoBridge.bind(fd, source, 0); } IoBridge.connect(fd, destination, 7, timeout); reached = true; } catch (IOException e) { if (e.getCause() instanceof ErrnoException) { // "Connection refused" means the IP address was reachable. reached = (((ErrnoException) e.getCause()).errno == ECONNREFUSED); } } IoBridge.closeSocket(fd); return reached; }