Code example for SSLSocket

Methods: close, getInetAddress, getInputStream, getOutputStream

0
            out.close();
            in.close();
            if (objOut != null) {
                objOut.close();
            } 
            sock.close();
            System.out.println("Server socket streams reset.");
            System.out.printf("Server listening on port %d.\n", servSock.getLocalPort());
            sock = (SSLSocket) servSock.accept();
            System.out.printf("Client connected from %s.\n", sock.getInetAddress());
            out = new BufferedWriter(new OutputStreamWriter(sock.getOutputStream()));
            in = new BufferedReader(new InputStreamReader(sock.getInputStream()));
        } catch (IOException ex) {
            System.out.println("Error while attempting to reset the socket.");
            ex.printStackTrace();
        } 
    } 
 
    /** 
     * Destroys the socket entirely, killing the server. 
     */