/** * Closes the socket. After this method is invoked, subsequent * read/write operations will fail. */ public void close() throws IOException { guard.close(); IoBridge.closeSocket(fd); }
@Override protected synchronized void implCloseSelectableChannel() throws IOException { connected = false; if (socket != null && !socket.isClosed()) { socket.close(); } else { IoBridge.closeSocket(fd); } }
@Override public synchronized void close() { guard.close(); try { IoBridge.closeSocket(fd); } catch (IOException ignored) { } }
@Override protected synchronized void close() throws IOException { guard.close(); IoBridge.closeSocket(fd); }
@Override protected synchronized void implCloseSelectableChannel() throws IOException { if (status != SOCKET_STATUS_CLOSED) { status = SOCKET_STATUS_CLOSED; if (socket != null && !socket.isClosed()) { socket.close(); } else { IoBridge.closeSocket(fd); } } }
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 public synchronized void close() { guard.close(); try { IoBridge.closeSocket(fd); } catch (IOException ignored) { } }
/** * Closes the socket. After this method is invoked, subsequent * read/write operations will fail. */ public void close() throws IOException { guard.close(); IoBridge.closeSocket(fd); }
@Override protected synchronized void implCloseSelectableChannel() throws IOException { connected = false; if (socket != null && !socket.isClosed()) { socket.close(); } else { IoBridge.closeSocket(fd); } }
@Override public synchronized void close() { guard.close(); try { IoBridge.closeSocket(fd); } catch (IOException ignored) { } }
/** * Closes the socket. After this method is invoked, subsequent * read/write operations will fail. */ public void close() throws IOException { guard.close(); IoBridge.closeSocket(fd); }
@Override protected synchronized void close() throws IOException { guard.close(); IoBridge.closeSocket(fd); }
@Override public synchronized void close() { guard.close(); try { IoBridge.closeSocket(fd); } catch (IOException ignored) { } }
@Override protected synchronized void close() throws IOException { guard.close(); IoBridge.closeSocket(fd); }
/** * Closes the socket. After this method is invoked, subsequent * read/write operations will fail. */ public void close() throws IOException { guard.close(); IoBridge.closeSocket(fd); }
@Override public synchronized void close() { guard.close(); try { IoBridge.closeSocket(fd); } catch (IOException ignored) { } }
@Override protected synchronized void implCloseSelectableChannel() throws IOException { if (status != SOCKET_STATUS_CLOSED) { status = SOCKET_STATUS_CLOSED; if (socket != null && !socket.isClosed()) { socket.close(); } else { IoBridge.closeSocket(fd); } } }
@Override protected synchronized void implCloseSelectableChannel() throws IOException { if (status != SOCKET_STATUS_CLOSED) { status = SOCKET_STATUS_CLOSED; if (socket != null && !socket.isClosed()) { socket.close(); } else { IoBridge.closeSocket(fd); } } }
@Override protected synchronized void implCloseSelectableChannel() throws IOException { if (status != SOCKET_STATUS_CLOSED) { status = SOCKET_STATUS_CLOSED; if (socket != null && !socket.isClosed()) { socket.close(); } else { IoBridge.closeSocket(fd); } } }
@Override protected synchronized void implCloseSelectableChannel() throws IOException { if (status != SOCKET_STATUS_CLOSED) { status = SOCKET_STATUS_CLOSED; if (socket != null && !socket.isClosed()) { socket.close(); } else { IoBridge.closeSocket(fd); } } }