src/java.base/share/classes/sun/nio/ch/ServerSocketAdaptor.java
author alanb
Thu, 08 Feb 2018 10:55:21 +0000
changeset 48761 74c1fa26435a
parent 47216 71c04702a3d5
child 49001 ce06058197a4
permissions -rw-r--r--
8196956: (ch) More channels cleanup Reviewed-by: rriggs, prappo, bpb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
48761
74c1fa26435a 8196956: (ch) More channels cleanup
alanb
parents: 47216
diff changeset
     2
 * Copyright (c) 2000, 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: 1247
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: 1247
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: 1247
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1247
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1247
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.nio.ch;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
48761
74c1fa26435a 8196956: (ch) More channels cleanup
alanb
parents: 47216
diff changeset
    28
import java.io.IOException;
74c1fa26435a 8196956: (ch) More channels cleanup
alanb
parents: 47216
diff changeset
    29
import java.net.InetAddress;
74c1fa26435a 8196956: (ch) More channels cleanup
alanb
parents: 47216
diff changeset
    30
import java.net.InetSocketAddress;
74c1fa26435a 8196956: (ch) More channels cleanup
alanb
parents: 47216
diff changeset
    31
import java.net.ServerSocket;
74c1fa26435a 8196956: (ch) More channels cleanup
alanb
parents: 47216
diff changeset
    32
import java.net.Socket;
74c1fa26435a 8196956: (ch) More channels cleanup
alanb
parents: 47216
diff changeset
    33
import java.net.SocketAddress;
74c1fa26435a 8196956: (ch) More channels cleanup
alanb
parents: 47216
diff changeset
    34
import java.net.SocketException;
74c1fa26435a 8196956: (ch) More channels cleanup
alanb
parents: 47216
diff changeset
    35
import java.net.SocketTimeoutException;
74c1fa26435a 8196956: (ch) More channels cleanup
alanb
parents: 47216
diff changeset
    36
import java.net.StandardSocketOptions;
74c1fa26435a 8196956: (ch) More channels cleanup
alanb
parents: 47216
diff changeset
    37
import java.nio.channels.ClosedChannelException;
74c1fa26435a 8196956: (ch) More channels cleanup
alanb
parents: 47216
diff changeset
    38
import java.nio.channels.IllegalBlockingModeException;
74c1fa26435a 8196956: (ch) More channels cleanup
alanb
parents: 47216
diff changeset
    39
import java.nio.channels.NotYetBoundException;
74c1fa26435a 8196956: (ch) More channels cleanup
alanb
parents: 47216
diff changeset
    40
import java.nio.channels.ServerSocketChannel;
74c1fa26435a 8196956: (ch) More channels cleanup
alanb
parents: 47216
diff changeset
    41
import java.nio.channels.SocketChannel;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
// Make a server-socket channel look like a server socket.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
//
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
// The methods in this class are defined in exactly the same order as in
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
// java.net.ServerSocket so as to simplify tracking future changes to that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
// class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
//
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
48761
74c1fa26435a 8196956: (ch) More channels cleanup
alanb
parents: 47216
diff changeset
    51
class ServerSocketAdaptor                        // package-private
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
    extends ServerSocket
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
    // The channel being adapted
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
    private final ServerSocketChannelImpl ssc;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
    // Timeout "option" value for accepts
34774
03b4e6dc367b 8145680: Remove unnecessary explicit initialization of volatile variables in java.base
redestad
parents: 25859
diff changeset
    59
    private volatile int timeout;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
    public static ServerSocket create(ServerSocketChannelImpl ssc) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
            return new ServerSocketAdaptor(ssc);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
        } catch (IOException x) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
            throw new Error(x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
    // ## super will create a useless impl
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    private ServerSocketAdaptor(ServerSocketChannelImpl ssc)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
        throws IOException
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
        this.ssc = ssc;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    public void bind(SocketAddress local) throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
        bind(local, 50);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
    public void bind(SocketAddress local, int backlog) throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
        if (local == null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
            local = new InetSocketAddress(0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
            ssc.bind(local, backlog);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
        } catch (Exception x) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
            Net.translateException(x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
    public InetAddress getInetAddress() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
        if (!ssc.isBound())
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
            return null;
18212
22f8c33b0690 8001318: Socket.getLocalAddress not consistent with InetAddress.getLocalHost
khazra
parents: 14342
diff changeset
    94
        return Net.getRevealedLocalAddress(ssc.localAddress()).getAddress();
22f8c33b0690 8001318: Socket.getLocalAddress not consistent with InetAddress.getLocalHost
khazra
parents: 14342
diff changeset
    95
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
    public int getLocalPort() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
        if (!ssc.isBound())
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
            return -1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
        return Net.asInetSocketAddress(ssc.localAddress()).getPort();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
    public Socket accept() throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
        synchronized (ssc.blockingLock()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
            try {
24623
c094ffea7aee 8024832: ServerSocketChannel.socket().accept() throws IllegalBlockingModeException if not bound
prappo
parents: 23010
diff changeset
   108
                if (!ssc.isBound())
c094ffea7aee 8024832: ServerSocketChannel.socket().accept() throws IllegalBlockingModeException if not bound
prappo
parents: 23010
diff changeset
   109
                    throw new NotYetBoundException();
48761
74c1fa26435a 8196956: (ch) More channels cleanup
alanb
parents: 47216
diff changeset
   110
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
                if (timeout == 0) {
48761
74c1fa26435a 8196956: (ch) More channels cleanup
alanb
parents: 47216
diff changeset
   112
                    // for compatibility reasons: accept connection if available
74c1fa26435a 8196956: (ch) More channels cleanup
alanb
parents: 47216
diff changeset
   113
                    // when configured non-blocking
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
                    SocketChannel sc = ssc.accept();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
                    if (sc == null && !ssc.isBlocking())
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
                        throw new IllegalBlockingModeException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
                    return sc.socket();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
48761
74c1fa26435a 8196956: (ch) More channels cleanup
alanb
parents: 47216
diff changeset
   120
                if (!ssc.isBlocking())
74c1fa26435a 8196956: (ch) More channels cleanup
alanb
parents: 47216
diff changeset
   121
                    throw new IllegalBlockingModeException();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
                ssc.configureBlocking(false);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
                try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
                    SocketChannel sc;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
                    if ((sc = ssc.accept()) != null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
                        return sc.socket();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
                    long to = timeout;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
                    for (;;) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
                        if (!ssc.isOpen())
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
                            throw new ClosedChannelException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
                        long st = System.currentTimeMillis();
22604
9b394795e216 8031997: PPC64: Make the various POLL constants system dependant
simonis
parents: 18212
diff changeset
   132
                        int result = ssc.poll(Net.POLLIN, to);
14025
fbebe005a3ee 7184932: Remove the temporary Selector usage in the NIO socket adapters
robm
parents: 9679
diff changeset
   133
                        if (result > 0 && ((sc = ssc.accept()) != null))
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
                            return sc.socket();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
                        to -= System.currentTimeMillis() - st;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
                        if (to <= 0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
                            throw new SocketTimeoutException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
                } finally {
48761
74c1fa26435a 8196956: (ch) More channels cleanup
alanb
parents: 47216
diff changeset
   140
                    try {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
                        ssc.configureBlocking(true);
48761
74c1fa26435a 8196956: (ch) More channels cleanup
alanb
parents: 47216
diff changeset
   142
                    } catch (ClosedChannelException e) { }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
            } catch (Exception x) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
                Net.translateException(x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
                assert false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
                return null;            // Never happens
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
    public void close() throws IOException {
5784
e565c553e9fc 6938230: (so) SocketAdaptor.close() does not translate IOException resulting in Error
alanb
parents: 5506
diff changeset
   153
        ssc.close();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
    public ServerSocketChannel getChannel() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
        return ssc;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
    public boolean isBound() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
        return ssc.isBound();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
    public boolean isClosed() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
        return !ssc.isOpen();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
    public void setSoTimeout(int timeout) throws SocketException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
        this.timeout = timeout;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
    public int getSoTimeout() throws SocketException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
        return timeout;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
    public void setReuseAddress(boolean on) throws SocketException {
1152
29d6145d1097 4640544: New I/O: Complete socket-channel functionality
alanb
parents: 2
diff changeset
   177
        try {
9679
d98ae8bc45fc 7042979: Rename StandardSocketOption and StandardWatchEventKind
alanb
parents: 7668
diff changeset
   178
            ssc.setOption(StandardSocketOptions.SO_REUSEADDR, on);
1152
29d6145d1097 4640544: New I/O: Complete socket-channel functionality
alanb
parents: 2
diff changeset
   179
        } catch (IOException x) {
29d6145d1097 4640544: New I/O: Complete socket-channel functionality
alanb
parents: 2
diff changeset
   180
            Net.translateToSocketException(x);
29d6145d1097 4640544: New I/O: Complete socket-channel functionality
alanb
parents: 2
diff changeset
   181
        }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
    public boolean getReuseAddress() throws SocketException {
1152
29d6145d1097 4640544: New I/O: Complete socket-channel functionality
alanb
parents: 2
diff changeset
   185
        try {
9679
d98ae8bc45fc 7042979: Rename StandardSocketOption and StandardWatchEventKind
alanb
parents: 7668
diff changeset
   186
            return ssc.getOption(StandardSocketOptions.SO_REUSEADDR).booleanValue();
1152
29d6145d1097 4640544: New I/O: Complete socket-channel functionality
alanb
parents: 2
diff changeset
   187
        } catch (IOException x) {
29d6145d1097 4640544: New I/O: Complete socket-channel functionality
alanb
parents: 2
diff changeset
   188
            Net.translateToSocketException(x);
29d6145d1097 4640544: New I/O: Complete socket-channel functionality
alanb
parents: 2
diff changeset
   189
            return false;       // Never happens
29d6145d1097 4640544: New I/O: Complete socket-channel functionality
alanb
parents: 2
diff changeset
   190
        }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
    public String toString() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
        if (!isBound())
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
            return "ServerSocket[unbound]";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
        return "ServerSocket[addr=" + getInetAddress() +
48761
74c1fa26435a 8196956: (ch) More channels cleanup
alanb
parents: 47216
diff changeset
   197
               ",localport=" + getLocalPort()  + "]";
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
    public void setReceiveBufferSize(int size) throws SocketException {
1152
29d6145d1097 4640544: New I/O: Complete socket-channel functionality
alanb
parents: 2
diff changeset
   201
        // size 0 valid for ServerSocketChannel, invalid for ServerSocket
29d6145d1097 4640544: New I/O: Complete socket-channel functionality
alanb
parents: 2
diff changeset
   202
        if (size <= 0)
29d6145d1097 4640544: New I/O: Complete socket-channel functionality
alanb
parents: 2
diff changeset
   203
            throw new IllegalArgumentException("size cannot be 0 or negative");
29d6145d1097 4640544: New I/O: Complete socket-channel functionality
alanb
parents: 2
diff changeset
   204
        try {
9679
d98ae8bc45fc 7042979: Rename StandardSocketOption and StandardWatchEventKind
alanb
parents: 7668
diff changeset
   205
            ssc.setOption(StandardSocketOptions.SO_RCVBUF, size);
1152
29d6145d1097 4640544: New I/O: Complete socket-channel functionality
alanb
parents: 2
diff changeset
   206
        } catch (IOException x) {
29d6145d1097 4640544: New I/O: Complete socket-channel functionality
alanb
parents: 2
diff changeset
   207
            Net.translateToSocketException(x);
29d6145d1097 4640544: New I/O: Complete socket-channel functionality
alanb
parents: 2
diff changeset
   208
        }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
    public int getReceiveBufferSize() throws SocketException {
1152
29d6145d1097 4640544: New I/O: Complete socket-channel functionality
alanb
parents: 2
diff changeset
   212
        try {
9679
d98ae8bc45fc 7042979: Rename StandardSocketOption and StandardWatchEventKind
alanb
parents: 7668
diff changeset
   213
            return ssc.getOption(StandardSocketOptions.SO_RCVBUF).intValue();
1152
29d6145d1097 4640544: New I/O: Complete socket-channel functionality
alanb
parents: 2
diff changeset
   214
        } catch (IOException x) {
29d6145d1097 4640544: New I/O: Complete socket-channel functionality
alanb
parents: 2
diff changeset
   215
            Net.translateToSocketException(x);
29d6145d1097 4640544: New I/O: Complete socket-channel functionality
alanb
parents: 2
diff changeset
   216
            return -1;          // Never happens
29d6145d1097 4640544: New I/O: Complete socket-channel functionality
alanb
parents: 2
diff changeset
   217
        }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
}