Code example for SSLSocket

Methods: close

0
            out.close();
            in.close();
            if (objIn != null) {
                objIn.close();
            } 
            sock.close();
            System.out.println("Client socket disconnected successfully.");
        } catch (IOException ex) {
            System.out.println("Failed to close the socket.");
        } 
    } 
 
    public void reset(){ 
        disconnect(); 
        initialiseSocket(); 
    } 
 
    /** 
     * Sends a single string to the server. The string should not contain new 
     * line characters. 
     * @param s