src/java.base/share/classes/javax/net/ssl/SSLSocket.java
changeset 51407 910f7b56592f
parent 47216 71c04702a3d5
child 51986 c1db377f6300
equal deleted inserted replaced
51406:f4b4dfac45b1 51407:910f7b56592f
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
   127  * as which messages should be sent by each party.  Each
   127  * as which messages should be sent by each party.  Each
   128  * connection must have one client and one server, or handshaking
   128  * connection must have one client and one server, or handshaking
   129  * will not progress properly.  Once the initial handshaking has started, a
   129  * will not progress properly.  Once the initial handshaking has started, a
   130  * socket can not switch between client and server modes, even when
   130  * socket can not switch between client and server modes, even when
   131  * performing renegotiations.
   131  * performing renegotiations.
       
   132  *
       
   133  * @apiNote
       
   134  * When the connection is no longer needed, the client and server
       
   135  * applications should each close both sides of their respective connection.
       
   136  * For {@code SSLSocket} objects, for example, an application can call
       
   137  * {@link Socket#shutdownOutput()} or {@link java.io.OutputStream#close()}
       
   138  * for output strean close and call {@link Socket#shutdownInput()} or
       
   139  * {@link java.io.InputStream#close()} for input stream close.  Note that
       
   140  * in some cases, closing the input stream may depend on the peer's output
       
   141  * stream being closed first.  If the connection is not closed in an orderly
       
   142  * manner (for example {@link Socket#shutdownInput()} is called before the
       
   143  * peer's write closure notification has been received), exceptions may
       
   144  * be raised to indicate that an error has occurred.  Once an
       
   145  * {@code SSLSocket} is closed, it is not reusable: a new {@code SSLSocket}
       
   146  * must be created.
   132  *
   147  *
   133  * @see java.net.Socket
   148  * @see java.net.Socket
   134  * @see SSLServerSocket
   149  * @see SSLServerSocket
   135  * @see SSLSocketFactory
   150  * @see SSLSocketFactory
   136  *
   151  *