src/java.base/share/classes/sun/security/ssl/BaseSSLSocketImpl.java
author wetmore
Fri, 11 May 2018 15:53:12 -0700
branchJDK-8145252-TLS13-branch
changeset 56542 56aaa6cb3693
parent 47216 71c04702a3d5
child 51407 910f7b56592f
permissions -rw-r--r--
Initial TLSv1.3 Implementation
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
56542
56aaa6cb3693 Initial TLSv1.3 Implementation
wetmore
parents: 47216
diff changeset
     2
 * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1580
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1580
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1580
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1580
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1580
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package sun.security.ssl;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.io.*;
56542
56aaa6cb3693 Initial TLSv1.3 Implementation
wetmore
parents: 47216
diff changeset
    29
import java.net.*;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import java.nio.channels.SocketChannel;
23883
9434a0a8208f 8040062: Need to add new methods in BaseSSLSocketImpl
xuelei
parents: 14664
diff changeset
    31
import java.util.Set;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import javax.net.ssl.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
/**
56542
56aaa6cb3693 Initial TLSv1.3 Implementation
wetmore
parents: 47216
diff changeset
    35
 * Abstract base class for SSLSocketImpl.
56aaa6cb3693 Initial TLSv1.3 Implementation
wetmore
parents: 47216
diff changeset
    36
 *
56aaa6cb3693 Initial TLSv1.3 Implementation
wetmore
parents: 47216
diff changeset
    37
 * Its purpose is to house code with no SSL related logic (or no logic at all).
56aaa6cb3693 Initial TLSv1.3 Implementation
wetmore
parents: 47216
diff changeset
    38
 * This makes SSLSocketImpl shorter and easier to read. It contains a few
56aaa6cb3693 Initial TLSv1.3 Implementation
wetmore
parents: 47216
diff changeset
    39
 * constants and static methods plus overridden java.net.Socket methods.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * Methods are defined final to ensure that they are not accidentally
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * overridden in SSLSocketImpl.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * @see javax.net.ssl.SSLSocket
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * @see SSLSocketImpl
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
abstract class BaseSSLSocketImpl extends SSLSocket {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
     * Normally "self" is "this" ... but not when this connection is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
     * layered over a preexisting socket.  If we're using an existing
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
     * socket, we delegate some actions to it.  Else, we delegate
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
     * instead to "super".  This is important to ensure that we don't
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
     * recurse infinitely ... e.g. close() calling itself, or doing
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
     * I/O in terms of our own streams.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
     */
32649
2ee9017c7597 8136583: Core libraries should use blessed modifier order
martin
parents: 25859
diff changeset
    57
    private final Socket self;
2ee9017c7597 8136583: Core libraries should use blessed modifier order
martin
parents: 25859
diff changeset
    58
    private final InputStream consumedInput;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
    BaseSSLSocketImpl() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
        super();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
        this.self = this;
14194
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
    63
        this.consumedInput = null;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
    BaseSSLSocketImpl(Socket socket) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
        super();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
        this.self = socket;
14194
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
    69
        this.consumedInput = null;
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
    70
    }
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
    71
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
    72
    BaseSSLSocketImpl(Socket socket, InputStream consumed) {
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
    73
        super();
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
    74
        this.self = socket;
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
    75
        this.consumedInput = consumed;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
    // CONSTANTS AND STATIC METHODS
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
     * TLS requires that a close_notify warning alert is sent before the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
     * connection is closed in order to avoid truncation attacks. Some
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
     * implementations (MS IIS and others) don't do that. The property
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
     * below controls whether we accept that or treat it as an error.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
     * The default is "false", i.e. tolerate the broken behavior.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
     */
32649
2ee9017c7597 8136583: Core libraries should use blessed modifier order
martin
parents: 25859
diff changeset
    90
    private static final String PROP_NAME =
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
                                "com.sun.net.ssl.requireCloseNotify";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
32649
2ee9017c7597 8136583: Core libraries should use blessed modifier order
martin
parents: 25859
diff changeset
    93
    static final boolean requireCloseNotify =
56542
56aaa6cb3693 Initial TLSv1.3 Implementation
wetmore
parents: 47216
diff changeset
    94
                                Utilities.getBooleanProperty(PROP_NAME, false);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
    // MISC SOCKET METHODS
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
     * Returns the unique {@link java.nio.SocketChannel SocketChannel} object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
     * associated with this socket, if any.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
     * @see java.net.Socket#getChannel
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
     */
14664
e71aa0962e70 8003950: Adds missing Override annotations and removes unnecessary imports in sun.security.ssl
xuelei
parents: 14194
diff changeset
   105
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
    public final SocketChannel getChannel() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
        if (self == this) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
            return super.getChannel();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
            return self.getChannel();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
     * Binds the address to the socket.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
     * @see java.net.Socket#bind
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
     */
14664
e71aa0962e70 8003950: Adds missing Override annotations and removes unnecessary imports in sun.security.ssl
xuelei
parents: 14194
diff changeset
   118
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
    public void bind(SocketAddress bindpoint) throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
        /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
         * Bind to this socket
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
        if (self == this) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
            super.bind(bindpoint);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
            // If we're binding on a layered socket...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
            throw new IOException(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
                "Underlying socket should already be connected");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
     * Returns the address of the endpoint this socket is connected to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
     * @see java.net.Socket#getLocalSocketAddress
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
     */
14664
e71aa0962e70 8003950: Adds missing Override annotations and removes unnecessary imports in sun.security.ssl
xuelei
parents: 14194
diff changeset
   136
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
    public SocketAddress getLocalSocketAddress() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
        if (self == this) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
            return super.getLocalSocketAddress();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
            return self.getLocalSocketAddress();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
     * Returns the address of the endpoint this socket is connected to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
     * @see java.net.Socket#getRemoteSocketAddress
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     */
14664
e71aa0962e70 8003950: Adds missing Override annotations and removes unnecessary imports in sun.security.ssl
xuelei
parents: 14194
diff changeset
   149
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
    public SocketAddress getRemoteSocketAddress() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
        if (self == this) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
            return super.getRemoteSocketAddress();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
            return self.getRemoteSocketAddress();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
     * Connects this socket to the server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
     * This method is either called on an unconnected SSLSocketImpl by the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
     * application, or it is called in the constructor of a regular
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
     * SSLSocketImpl. If we are layering on top on another socket, then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
     * this method should not be called, because we assume that the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
     * underlying socket is already connected by the time it is passed to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
     * us.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
     * @param   endpoint the <code>SocketAddress</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
     * @throws  IOException if an error occurs during the connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
     */
14664
e71aa0962e70 8003950: Adds missing Override annotations and removes unnecessary imports in sun.security.ssl
xuelei
parents: 14194
diff changeset
   171
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
    public final void connect(SocketAddress endpoint) throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
        connect(endpoint, 0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
     * Returns the connection state of the socket.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
     * @see java.net.Socket#isConnected
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
     */
14664
e71aa0962e70 8003950: Adds missing Override annotations and removes unnecessary imports in sun.security.ssl
xuelei
parents: 14194
diff changeset
   180
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
    public final boolean isConnected() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
        if (self == this) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
            return super.isConnected();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
            return self.isConnected();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
     * Returns the binding state of the socket.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
     * @see java.net.Socket#isBound
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
     */
14664
e71aa0962e70 8003950: Adds missing Override annotations and removes unnecessary imports in sun.security.ssl
xuelei
parents: 14194
diff changeset
   193
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
    public final boolean isBound() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
        if (self == this) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
            return super.isBound();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
            return self.isBound();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
    // CLOSE RELATED METHODS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
     * The semantics of shutdownInput is not supported in TLS 1.0
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
     * spec. Thus when the method is called on an SSL socket, an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
     * UnsupportedOperationException will be thrown.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
     * @throws UnsupportedOperationException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
     */
14664
e71aa0962e70 8003950: Adds missing Override annotations and removes unnecessary imports in sun.security.ssl
xuelei
parents: 14194
diff changeset
   213
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
    public final void shutdownInput() throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
        throw new UnsupportedOperationException("The method shutdownInput()" +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
                   " is not supported in SSLSocket");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
     * The semantics of shutdownOutput is not supported in TLS 1.0
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
     * spec. Thus when the method is called on an SSL socket, an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
     * UnsupportedOperationException will be thrown.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
     * @throws UnsupportedOperationException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
     */
14664
e71aa0962e70 8003950: Adds missing Override annotations and removes unnecessary imports in sun.security.ssl
xuelei
parents: 14194
diff changeset
   226
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
    public final void shutdownOutput() throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
        throw new UnsupportedOperationException("The method shutdownOutput()" +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
                   " is not supported in SSLSocket");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
     * Returns the input state of the socket
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
     * @see java.net.Socket#isInputShutdown
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
     */
14664
e71aa0962e70 8003950: Adds missing Override annotations and removes unnecessary imports in sun.security.ssl
xuelei
parents: 14194
diff changeset
   237
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
    public final boolean isInputShutdown() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
        if (self == this) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
            return super.isInputShutdown();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
            return self.isInputShutdown();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
     * Returns the output state of the socket
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
     * @see java.net.Socket#isOutputShutdown
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
     */
14664
e71aa0962e70 8003950: Adds missing Override annotations and removes unnecessary imports in sun.security.ssl
xuelei
parents: 14194
diff changeset
   250
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
    public final boolean isOutputShutdown() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
        if (self == this) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
            return super.isOutputShutdown();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
            return self.isOutputShutdown();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
     * Ensures that the SSL connection is closed down as cleanly
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
     * as possible, in case the application forgets to do so.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
     * This allows SSL connections to be implicitly reclaimed,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
     * rather than forcing them to be explicitly reclaimed at
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
     * the penalty of prematurly killing SSL sessions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
     */
14664
e71aa0962e70 8003950: Adds missing Override annotations and removes unnecessary imports in sun.security.ssl
xuelei
parents: 14194
diff changeset
   266
    @Override
44534
a076dffbc2c1 8165641: Deprecate Object.finalize
rriggs
parents: 32649
diff changeset
   267
    @SuppressWarnings("deprecation")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
    protected final void finalize() throws Throwable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
            close();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
        } catch (IOException e1) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
            try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
                if (self == this) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
                    super.close();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
            } catch (IOException e2) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
                // ignore
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
        } finally {
1580
9af5946d4060 6745052: SLServerSocket file descriptor leak
xuelei
parents: 2
diff changeset
   280
            // We called close on the underlying socket above to
9af5946d4060 6745052: SLServerSocket file descriptor leak
xuelei
parents: 2
diff changeset
   281
            // make doubly sure all resources got released.  We
9af5946d4060 6745052: SLServerSocket file descriptor leak
xuelei
parents: 2
diff changeset
   282
            // don't finalize self in the case of overlain sockets,
9af5946d4060 6745052: SLServerSocket file descriptor leak
xuelei
parents: 2
diff changeset
   283
            // that's a different object which the GC will finalize
9af5946d4060 6745052: SLServerSocket file descriptor leak
xuelei
parents: 2
diff changeset
   284
            // separately.
9af5946d4060 6745052: SLServerSocket file descriptor leak
xuelei
parents: 2
diff changeset
   285
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
            super.finalize();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
    // GET ADDRESS METHODS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
     * Returns the address of the remote peer for this connection.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
     */
14664
e71aa0962e70 8003950: Adds missing Override annotations and removes unnecessary imports in sun.security.ssl
xuelei
parents: 14194
diff changeset
   297
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
    public final InetAddress getInetAddress() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
        if (self == this) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
            return super.getInetAddress();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
            return self.getInetAddress();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
     * Gets the local address to which the socket is bound.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
     * @return the local address to which the socket is bound.
24865
09b1d992ca72 8044740: Convert all JDK versions used in @since tag to 1.n[.n] in jdk repo
henryjen
parents: 23883
diff changeset
   310
     * @since   1.1
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
     */
14664
e71aa0962e70 8003950: Adds missing Override annotations and removes unnecessary imports in sun.security.ssl
xuelei
parents: 14194
diff changeset
   312
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
    public final InetAddress getLocalAddress() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
        if (self == this) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
            return super.getLocalAddress();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
            return self.getLocalAddress();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
     * Returns the number of the remote port that this connection uses.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
     */
14664
e71aa0962e70 8003950: Adds missing Override annotations and removes unnecessary imports in sun.security.ssl
xuelei
parents: 14194
diff changeset
   324
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
    public final int getPort() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
        if (self == this) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
            return super.getPort();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
            return self.getPort();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
     * Returns the number of the local port that this connection uses.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
     */
14664
e71aa0962e70 8003950: Adds missing Override annotations and removes unnecessary imports in sun.security.ssl
xuelei
parents: 14194
diff changeset
   336
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
    public final int getLocalPort() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
        if (self == this) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
            return super.getLocalPort();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
            return self.getLocalPort();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
    // SOCKET OPTION METHODS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
     * Enables or disables the Nagle optimization.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
     * @see java.net.Socket#setTcpNoDelay
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
     */
14664
e71aa0962e70 8003950: Adds missing Override annotations and removes unnecessary imports in sun.security.ssl
xuelei
parents: 14194
diff changeset
   353
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
    public final void setTcpNoDelay(boolean value) throws SocketException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
        if (self == this) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
            super.setTcpNoDelay(value);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
            self.setTcpNoDelay(value);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
     * Returns true if the Nagle optimization is disabled.  This
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
     * relates to low-level buffering of TCP traffic, delaying the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
     * traffic to promote better throughput.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
     * @see java.net.Socket#getTcpNoDelay
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
     */
14664
e71aa0962e70 8003950: Adds missing Override annotations and removes unnecessary imports in sun.security.ssl
xuelei
parents: 14194
diff changeset
   369
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
    public final boolean getTcpNoDelay() throws SocketException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
        if (self == this) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
            return super.getTcpNoDelay();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
            return self.getTcpNoDelay();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
     * Assigns the socket's linger timeout.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
     * @see java.net.Socket#setSoLinger
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
     */
14664
e71aa0962e70 8003950: Adds missing Override annotations and removes unnecessary imports in sun.security.ssl
xuelei
parents: 14194
diff changeset
   382
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
    public final void setSoLinger(boolean flag, int linger)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
            throws SocketException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
        if (self == this) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
            super.setSoLinger(flag, linger);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
            self.setSoLinger(flag, linger);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
     * Returns the socket's linger timeout.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
     * @see java.net.Socket#getSoLinger
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
     */
14664
e71aa0962e70 8003950: Adds missing Override annotations and removes unnecessary imports in sun.security.ssl
xuelei
parents: 14194
diff changeset
   396
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
    public final int getSoLinger() throws SocketException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
        if (self == this) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
            return super.getSoLinger();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
            return self.getSoLinger();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
     * Send one byte of urgent data on the socket.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
     * @see java.net.Socket#sendUrgentData
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
     * At this point, there seems to be no specific requirement to support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
     * this for an SSLSocket. An implementation can be provided if a need
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
     * arises in future.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
     */
14664
e71aa0962e70 8003950: Adds missing Override annotations and removes unnecessary imports in sun.security.ssl
xuelei
parents: 14194
diff changeset
   412
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
    public final void sendUrgentData(int data) throws SocketException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
        throw new SocketException("This method is not supported "
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
                        + "by SSLSockets");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
     * Enable/disable OOBINLINE (receipt of TCP urgent data) By default, this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
     * option is disabled and TCP urgent data received on a socket is silently
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
     * discarded.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
     * @see java.net.Socket#setOOBInline
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
     * Setting OOBInline does not have any effect on SSLSocket,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
     * since currently we don't support sending urgent data.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
     */
14664
e71aa0962e70 8003950: Adds missing Override annotations and removes unnecessary imports in sun.security.ssl
xuelei
parents: 14194
diff changeset
   426
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
    public final void setOOBInline(boolean on) throws SocketException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
        throw new SocketException("This method is ineffective, since"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
                + " sending urgent data is not supported by SSLSockets");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
     * Tests if OOBINLINE is enabled.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
     * @see java.net.Socket#getOOBInline
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
     */
14664
e71aa0962e70 8003950: Adds missing Override annotations and removes unnecessary imports in sun.security.ssl
xuelei
parents: 14194
diff changeset
   436
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
    public final boolean getOOBInline() throws SocketException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
        throw new SocketException("This method is ineffective, since"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
                + " sending urgent data is not supported by SSLSockets");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
     * Returns the socket timeout.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
     * @see java.net.Socket#getSoTimeout
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
     */
14664
e71aa0962e70 8003950: Adds missing Override annotations and removes unnecessary imports in sun.security.ssl
xuelei
parents: 14194
diff changeset
   446
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
    public final int getSoTimeout() throws SocketException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
        if (self == this) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
            return super.getSoTimeout();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
            return self.getSoTimeout();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
14664
e71aa0962e70 8003950: Adds missing Override annotations and removes unnecessary imports in sun.security.ssl
xuelei
parents: 14194
diff changeset
   455
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
    public final void setSendBufferSize(int size) throws SocketException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
        if (self == this) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
            super.setSendBufferSize(size);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
            self.setSendBufferSize(size);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
14664
e71aa0962e70 8003950: Adds missing Override annotations and removes unnecessary imports in sun.security.ssl
xuelei
parents: 14194
diff changeset
   464
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
    public final int getSendBufferSize() throws SocketException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
        if (self == this) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
            return super.getSendBufferSize();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
            return self.getSendBufferSize();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   470
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   471
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   472
14664
e71aa0962e70 8003950: Adds missing Override annotations and removes unnecessary imports in sun.security.ssl
xuelei
parents: 14194
diff changeset
   473
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   474
    public final void setReceiveBufferSize(int size) throws SocketException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   475
        if (self == this) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   476
            super.setReceiveBufferSize(size);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   477
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   478
            self.setReceiveBufferSize(size);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   479
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   480
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   481
14664
e71aa0962e70 8003950: Adds missing Override annotations and removes unnecessary imports in sun.security.ssl
xuelei
parents: 14194
diff changeset
   482
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   483
    public final int getReceiveBufferSize() throws SocketException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   484
        if (self == this) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   485
            return super.getReceiveBufferSize();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   486
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   487
            return self.getReceiveBufferSize();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   488
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   489
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   490
90ce3da70b43 Initial load
duke
parents:
diff changeset
   491
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   492
     * Enable/disable SO_KEEPALIVE.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   493
     * @see java.net.Socket#setKeepAlive
90ce3da70b43 Initial load
duke
parents:
diff changeset
   494
     */
14664
e71aa0962e70 8003950: Adds missing Override annotations and removes unnecessary imports in sun.security.ssl
xuelei
parents: 14194
diff changeset
   495
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   496
    public final void setKeepAlive(boolean on) throws SocketException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   497
        if (self == this) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   498
            super.setKeepAlive(on);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   499
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   500
            self.setKeepAlive(on);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   501
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   502
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   503
90ce3da70b43 Initial load
duke
parents:
diff changeset
   504
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   505
     * Tests if SO_KEEPALIVE is enabled.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   506
     * @see java.net.Socket#getKeepAlive
90ce3da70b43 Initial load
duke
parents:
diff changeset
   507
     */
14664
e71aa0962e70 8003950: Adds missing Override annotations and removes unnecessary imports in sun.security.ssl
xuelei
parents: 14194
diff changeset
   508
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   509
    public final boolean getKeepAlive() throws SocketException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   510
        if (self == this) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   511
            return super.getKeepAlive();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   512
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   513
            return self.getKeepAlive();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   514
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   515
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   516
90ce3da70b43 Initial load
duke
parents:
diff changeset
   517
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   518
     * Sets traffic class or type-of-service octet in the IP header for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   519
     * packets sent from this Socket.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   520
     * @see java.net.Socket#setTrafficClass
90ce3da70b43 Initial load
duke
parents:
diff changeset
   521
     */
14664
e71aa0962e70 8003950: Adds missing Override annotations and removes unnecessary imports in sun.security.ssl
xuelei
parents: 14194
diff changeset
   522
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   523
    public final void setTrafficClass(int tc) throws SocketException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   524
        if (self == this) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   525
            super.setTrafficClass(tc);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   526
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   527
            self.setTrafficClass(tc);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   528
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   529
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   530
90ce3da70b43 Initial load
duke
parents:
diff changeset
   531
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   532
     * Gets traffic class or type-of-service in the IP header for packets
90ce3da70b43 Initial load
duke
parents:
diff changeset
   533
     * sent from this Socket.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   534
     * @see java.net.Socket#getTrafficClass
90ce3da70b43 Initial load
duke
parents:
diff changeset
   535
     */
14664
e71aa0962e70 8003950: Adds missing Override annotations and removes unnecessary imports in sun.security.ssl
xuelei
parents: 14194
diff changeset
   536
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   537
    public final int getTrafficClass() throws SocketException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   538
        if (self == this) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   539
            return super.getTrafficClass();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   540
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   541
            return self.getTrafficClass();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   542
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   543
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   544
90ce3da70b43 Initial load
duke
parents:
diff changeset
   545
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   546
     * Enable/disable SO_REUSEADDR.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   547
     * @see java.net.Socket#setReuseAddress
90ce3da70b43 Initial load
duke
parents:
diff changeset
   548
     */
14664
e71aa0962e70 8003950: Adds missing Override annotations and removes unnecessary imports in sun.security.ssl
xuelei
parents: 14194
diff changeset
   549
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   550
    public final void setReuseAddress(boolean on) throws SocketException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   551
        if (self == this) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   552
            super.setReuseAddress(on);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   553
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   554
            self.setReuseAddress(on);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   555
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   556
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   557
90ce3da70b43 Initial load
duke
parents:
diff changeset
   558
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   559
     * Tests if SO_REUSEADDR is enabled.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   560
     * @see java.net.Socket#getReuseAddress
90ce3da70b43 Initial load
duke
parents:
diff changeset
   561
     */
14664
e71aa0962e70 8003950: Adds missing Override annotations and removes unnecessary imports in sun.security.ssl
xuelei
parents: 14194
diff changeset
   562
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   563
    public final boolean getReuseAddress() throws SocketException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   564
        if (self == this) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   565
            return super.getReuseAddress();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   566
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   567
            return self.getReuseAddress();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   568
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   569
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   570
90ce3da70b43 Initial load
duke
parents:
diff changeset
   571
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   572
     * Sets performance preferences for this socket.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   573
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   574
     * @see java.net.Socket#setPerformancePreferences(int, int, int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   575
     */
14664
e71aa0962e70 8003950: Adds missing Override annotations and removes unnecessary imports in sun.security.ssl
xuelei
parents: 14194
diff changeset
   576
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   577
    public void setPerformancePreferences(int connectionTime,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   578
            int latency, int bandwidth) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   579
        if (self == this) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   580
            super.setPerformancePreferences(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   581
                connectionTime, latency, bandwidth);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   582
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   583
            self.setPerformancePreferences(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   584
                connectionTime, latency, bandwidth);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   585
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   586
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   587
14194
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   588
    @Override
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   589
    public String toString() {
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   590
        if (self == this) {
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   591
            return super.toString();
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   592
        }
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   593
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   594
        return self.toString();
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   595
    }
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   596
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   597
    @Override
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   598
    public InputStream getInputStream() throws IOException {
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   599
        if (self == this) {
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   600
            return super.getInputStream();
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   601
        }
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   602
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   603
        if (consumedInput != null) {
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   604
            return new SequenceInputStream(consumedInput,
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   605
                                                self.getInputStream());
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   606
        }
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   607
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   608
        return self.getInputStream();
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   609
    }
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   610
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   611
    @Override
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   612
    public OutputStream getOutputStream() throws IOException {
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   613
        if (self == this) {
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   614
            return super.getOutputStream();
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   615
        }
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   616
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   617
        return self.getOutputStream();
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   618
    }
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   619
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   620
    @Override
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   621
    public synchronized void close() throws IOException {
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   622
        if (self == this) {
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   623
            super.close();
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   624
        } else {
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   625
            self.close();
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   626
        }
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   627
    }
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   628
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   629
    @Override
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   630
    public synchronized void setSoTimeout(int timeout) throws SocketException {
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   631
        if (self == this) {
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   632
            super.setSoTimeout(timeout);
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   633
        } else {
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   634
            self.setSoTimeout(timeout);
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   635
        }
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   636
    }
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   637
23883
9434a0a8208f 8040062: Need to add new methods in BaseSSLSocketImpl
xuelei
parents: 14664
diff changeset
   638
    @Override
9434a0a8208f 8040062: Need to add new methods in BaseSSLSocketImpl
xuelei
parents: 14664
diff changeset
   639
    public <T> Socket setOption(SocketOption<T> name,
9434a0a8208f 8040062: Need to add new methods in BaseSSLSocketImpl
xuelei
parents: 14664
diff changeset
   640
            T value) throws IOException {
9434a0a8208f 8040062: Need to add new methods in BaseSSLSocketImpl
xuelei
parents: 14664
diff changeset
   641
        if (self == this) {
9434a0a8208f 8040062: Need to add new methods in BaseSSLSocketImpl
xuelei
parents: 14664
diff changeset
   642
            return super.setOption(name, value);
9434a0a8208f 8040062: Need to add new methods in BaseSSLSocketImpl
xuelei
parents: 14664
diff changeset
   643
        } else {
9434a0a8208f 8040062: Need to add new methods in BaseSSLSocketImpl
xuelei
parents: 14664
diff changeset
   644
            return self.setOption(name, value);
9434a0a8208f 8040062: Need to add new methods in BaseSSLSocketImpl
xuelei
parents: 14664
diff changeset
   645
        }
9434a0a8208f 8040062: Need to add new methods in BaseSSLSocketImpl
xuelei
parents: 14664
diff changeset
   646
    }
9434a0a8208f 8040062: Need to add new methods in BaseSSLSocketImpl
xuelei
parents: 14664
diff changeset
   647
9434a0a8208f 8040062: Need to add new methods in BaseSSLSocketImpl
xuelei
parents: 14664
diff changeset
   648
    @Override
9434a0a8208f 8040062: Need to add new methods in BaseSSLSocketImpl
xuelei
parents: 14664
diff changeset
   649
    public <T> T getOption(SocketOption<T> name) throws IOException {
9434a0a8208f 8040062: Need to add new methods in BaseSSLSocketImpl
xuelei
parents: 14664
diff changeset
   650
        if (self == this) {
9434a0a8208f 8040062: Need to add new methods in BaseSSLSocketImpl
xuelei
parents: 14664
diff changeset
   651
            return super.getOption(name);
9434a0a8208f 8040062: Need to add new methods in BaseSSLSocketImpl
xuelei
parents: 14664
diff changeset
   652
        } else {
9434a0a8208f 8040062: Need to add new methods in BaseSSLSocketImpl
xuelei
parents: 14664
diff changeset
   653
            return self.getOption(name);
9434a0a8208f 8040062: Need to add new methods in BaseSSLSocketImpl
xuelei
parents: 14664
diff changeset
   654
        }
9434a0a8208f 8040062: Need to add new methods in BaseSSLSocketImpl
xuelei
parents: 14664
diff changeset
   655
    }
9434a0a8208f 8040062: Need to add new methods in BaseSSLSocketImpl
xuelei
parents: 14664
diff changeset
   656
9434a0a8208f 8040062: Need to add new methods in BaseSSLSocketImpl
xuelei
parents: 14664
diff changeset
   657
    @Override
9434a0a8208f 8040062: Need to add new methods in BaseSSLSocketImpl
xuelei
parents: 14664
diff changeset
   658
    public Set<SocketOption<?>> supportedOptions() {
9434a0a8208f 8040062: Need to add new methods in BaseSSLSocketImpl
xuelei
parents: 14664
diff changeset
   659
        if (self == this) {
9434a0a8208f 8040062: Need to add new methods in BaseSSLSocketImpl
xuelei
parents: 14664
diff changeset
   660
            return super.supportedOptions();
9434a0a8208f 8040062: Need to add new methods in BaseSSLSocketImpl
xuelei
parents: 14664
diff changeset
   661
        } else {
9434a0a8208f 8040062: Need to add new methods in BaseSSLSocketImpl
xuelei
parents: 14664
diff changeset
   662
            return self.supportedOptions();
9434a0a8208f 8040062: Need to add new methods in BaseSSLSocketImpl
xuelei
parents: 14664
diff changeset
   663
        }
9434a0a8208f 8040062: Need to add new methods in BaseSSLSocketImpl
xuelei
parents: 14664
diff changeset
   664
    }
9434a0a8208f 8040062: Need to add new methods in BaseSSLSocketImpl
xuelei
parents: 14664
diff changeset
   665
14194
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   666
    boolean isLayered() {
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   667
        return (self != this);
971f46db533d 7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server
xuelei
parents: 5506
diff changeset
   668
    }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   669
}