public final void connect(SocketAddress endpoint, int timeout) throws IOException { if (!(endpoint instanceof InetSocketAddress)) { throw new IOException("Not an InetSocketAddress"); } if (isConnected()) { throw new SocketException("Socket is already connected"); } if (isClosed()) { throw new SocketException("Socket is closed"); } onConnect((InetSocketAddress) endpoint, timeout); }
public final void connect(SocketAddress endpoint, int timeout) throws IOException { if (!(endpoint instanceof InetSocketAddress)) { throw new IOException("Not an InetSocketAddress"); } if (isConnected()) { throw new SocketException("Socket is already connected"); } if (isClosed()) { throw new SocketException("Socket is closed"); } onConnect((InetSocketAddress) endpoint, timeout); }
public void shutdownOutput() throws IOException { if (isClosed()) throw new SocketException("Socket is closed"); if (!isConnected()) throw new SocketException("Socket is not connected"); if (isOutputShutdown()) throw new SocketException("Socket output is already shutdown"); getOutputStream().close(); shutOut = true; }
public void shutdownOutput() throws IOException { if (isClosed()) throw new SocketException("Socket is closed"); if (!isConnected()) throw new SocketException("Socket is not connected"); if (isOutputShutdown()) throw new SocketException("Socket output is already shutdown"); getOutputStream().close(); shutOut = true; }
public void shutdownInput() throws IOException { if (isClosed()) throw new SocketException("Socket is closed"); if (!isConnected()) throw new SocketException("Socket is not connected"); if (isInputShutdown()) throw new SocketException("Socket input is already shutdown"); getInputStream().close(); shutIn = true; }
public void shutdownInput() throws IOException { if (isClosed()) throw new SocketException("Socket is closed"); if (!isConnected()) throw new SocketException("Socket is not connected"); if (isInputShutdown()) throw new SocketException("Socket input is already shutdown"); getInputStream().close(); shutIn = true; }