Code example for Socket

Methods: isBoundisClosedisConnectedisInputShutdownisOutputShutdown

0
    public void disconnect() { 
        if (isConnected()) { 
            try { 
                inputStream.close();
                outputStream.close();
                if (!socket.isClosed()) {
                    socket.close();
                } 
            } catch (IOException ex) {
                throw new JedisConnectionException(ex);
            } 
        } 
    } 
 
    public boolean isConnected() { 
        return socket != null && socket.isBound() && !socket.isClosed()
                && socket.isConnected() && !socket.isInputShutdown()
                && !socket.isOutputShutdown();
    } 
 
    protected String getStatusCodeReply() {
        flush(); 
        pipelinedCommands--;
Stop searching for code, let great code find you!  Add Codota to your java IDE