Code example for SocketException

0
    private final boolean autoClose;
 
    protected SSLSocketWrapper(Socket socket, boolean autoClose, SSLParameters sslParameters) throws IOException {
        super(sslParameters);
        if (!socket.isConnected()) {
            throw new SocketException("Socket is not connected.");
        } 
        this.socket = socket;
        this.autoClose = autoClose;
        init(); 
    } 
 
    @Override 
    protected void initTransportLayer() throws IOException { 
        input = socket.getInputStream();
        output = socket.getOutputStream();
    } 
 
    @Override 
    protected void closeTransportLayer() throws IOException { 
        if (autoClose && (input != null)) {