Example usage for javax.net.ssl SSLServerSocket close

List of usage examples for javax.net.ssl SSLServerSocket close

Introduction

In this page you can find the example usage for javax.net.ssl SSLServerSocket close.

Prototype

public void close() throws IOException 

Source Link

Document

Closes this socket.

Usage

From source file:SecureServer.java

public static void main(String[] args) throws Exception {
    ServerSocketFactory ssf = SSLServerSocketFactory.getDefault();
    SSLServerSocket ss = (SSLServerSocket) ssf.createServerSocket(98999);
    Socket sock = ss.accept();// w ww .j  a  va 2s. com
    ss.close();
    OutputStream rawOut = sock.getOutputStream();
    PrintWriter out = new PrintWriter(new OutputStreamWriter(rawOut));
    out.println(new java.util.Date().toString());
    out.flush();
    sock.close();

}