jdk/src/share/classes/com/sun/nio/sctp/SctpMultiChannel.java
author alanb
Mon, 09 May 2011 18:45:33 +0100
changeset 9679 d98ae8bc45fc
parent 5506 202f599c92aa
child 11823 ee83ae88512d
permissions -rw-r--r--
7042979: Rename StandardSocketOption and StandardWatchEventKind Reviewed-by: forax, chegar
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2542
diff changeset
     2
 * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
     4
 *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
d859108aea12 4927640: Implementation of the sctp protocol
chegar
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: 2542
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2542
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    10
 *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    15
 * accompanied this code).
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    16
 *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2542
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2542
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2542
diff changeset
    23
 * questions.
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    24
 */
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    25
package com.sun.nio.sctp;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    26
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    27
import java.net.SocketAddress;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    28
import java.net.InetAddress;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    29
import java.io.IOException;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    30
import java.util.Set;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    31
import java.nio.ByteBuffer;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    32
import java.nio.channels.spi.AbstractSelectableChannel;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    33
import java.nio.channels.spi.SelectorProvider;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    34
import java.nio.channels.ClosedChannelException;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    35
import java.nio.channels.NotYetBoundException;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    36
import java.nio.channels.SelectionKey;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    37
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    38
/**
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    39
 * A selectable channel for message-oriented SCTP sockets.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    40
 *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    41
 * <P> An SCTP multi channel supports many associations on a single socket.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    42
 * An {@code SctpMultiChannel} is created by invoking the
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    43
 * {@link #open open} method of this class. A newly-created channel is open but
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    44
 * not yet bound. An attempt to invoke the {@link #receive receive} method of an
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    45
 * unbound channel will cause the {@link NotYetBoundException}
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    46
 * to be thrown. An attempt to invoke the {@link #send send} method of an
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    47
 * unbound channel will cause it to first invoke the {@link #bind bind} method.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    48
 * The address(es) that the channel's socket is bound to can be retrieved by
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    49
 * calling {@link #getAllLocalAddresses getAllLocalAddresses}.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    50
 *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    51
 * <P> Messages may be sent and received without explicitly setting up an
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    52
 * association with the remote peer. The channel will implicitly setup
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    53
 * a new association whenever it sends or receives a message from a remote
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    54
 * peer if there is not already an association with that peer. Upon successful
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    55
 * association setup, an {@link AssociationChangeNotification
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    56
 * association changed} notification will be put to the SCTP stack with its
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    57
 * {@code event} parameter set to {@link
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    58
 * AssociationChangeNotification.AssocChangeEvent#COMM_UP
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    59
 * COMM_UP}. This notification can be received by invoking {@link #receive
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    60
 * receive}.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    61
 *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    62
 * <P> Socket options are configured using the
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    63
 * {@link #setOption(SctpSocketOption,Object,Association) setOption} method. An
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    64
 * {@code SctpMultiChannel} supports the following options:
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    65
 * <blockquote>
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    66
 * <table border>
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    67
 *   <tr>
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    68
 *     <th>Option Name</th>
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    69
 *     <th>Description</th>
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    70
 *   </tr>
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    71
 *   <tr>
9679
d98ae8bc45fc 7042979: Rename StandardSocketOption and StandardWatchEventKind
alanb
parents: 5506
diff changeset
    72
 *     <td> {@link SctpStandardSocketOptions#SCTP_DISABLE_FRAGMENTS
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    73
 *                                          SCTP_DISABLE_FRAGMENTS} </td>
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    74
 *     <td> Enables or disables message fragmentation </td>
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    75
 *   </tr>
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    76
 *   <tr>
9679
d98ae8bc45fc 7042979: Rename StandardSocketOption and StandardWatchEventKind
alanb
parents: 5506
diff changeset
    77
 *     <td> {@link SctpStandardSocketOptions#SCTP_EXPLICIT_COMPLETE
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    78
 *                                          SCTP_EXPLICIT_COMPLETE} </td>
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    79
 *     <td> Enables or disables explicit message completion </td>
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    80
 *   </tr>
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    81
 *    <tr>
9679
d98ae8bc45fc 7042979: Rename StandardSocketOption and StandardWatchEventKind
alanb
parents: 5506
diff changeset
    82
 *     <td> {@link SctpStandardSocketOptions#SCTP_FRAGMENT_INTERLEAVE
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    83
 *                                          SCTP_FRAGMENT_INTERLEAVE} </td>
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    84
 *     <td> Controls how the presentation of messages occur for the message
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    85
 *          receiver </td>
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    86
 *   </tr>
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    87
 *   <tr>
9679
d98ae8bc45fc 7042979: Rename StandardSocketOption and StandardWatchEventKind
alanb
parents: 5506
diff changeset
    88
 *     <td> {@link SctpStandardSocketOptions#SCTP_INIT_MAXSTREAMS
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    89
 *                                          SCTP_INIT_MAXSTREAMS} </td>
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    90
 *     <td> The maximum number of streams requested by the local endpoint during
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    91
 *          association initialization </td>
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    92
 *   </tr>
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    93
 *   <tr>
9679
d98ae8bc45fc 7042979: Rename StandardSocketOption and StandardWatchEventKind
alanb
parents: 5506
diff changeset
    94
 *     <td> {@link SctpStandardSocketOptions#SCTP_NODELAY SCTP_NODELAY} </td>
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    95
 *     <td> Enables or disable a Nagle-like algorithm </td>
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    96
 *   </tr>
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    97
 *   <tr>
9679
d98ae8bc45fc 7042979: Rename StandardSocketOption and StandardWatchEventKind
alanb
parents: 5506
diff changeset
    98
 *     <td> {@link SctpStandardSocketOptions#SCTP_PRIMARY_ADDR
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
    99
 *                                          SCTP_PRIMARY_ADDR} </td>
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   100
 *     <td> Requests that the local SCTP stack use the given peer address as the
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   101
 *          association primary </td>
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   102
 *   </tr>
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   103
 *   <tr>
9679
d98ae8bc45fc 7042979: Rename StandardSocketOption and StandardWatchEventKind
alanb
parents: 5506
diff changeset
   104
 *     <td> {@link SctpStandardSocketOptions#SCTP_SET_PEER_PRIMARY_ADDR
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   105
 *                                          SCTP_SET_PEER_PRIMARY_ADDR} </td>
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   106
 *     <td> Requests that the peer mark the enclosed address as the association
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   107
 *          primary </td>
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   108
 *   </tr>
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   109
 *   <tr>
9679
d98ae8bc45fc 7042979: Rename StandardSocketOption and StandardWatchEventKind
alanb
parents: 5506
diff changeset
   110
 *     <td> {@link SctpStandardSocketOptions#SO_SNDBUF
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   111
 *                                          SO_SNDBUF} </td>
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   112
 *     <td> The size of the socket send buffer </td>
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   113
 *   </tr>
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   114
 *   <tr>
9679
d98ae8bc45fc 7042979: Rename StandardSocketOption and StandardWatchEventKind
alanb
parents: 5506
diff changeset
   115
 *     <td> {@link SctpStandardSocketOptions#SO_RCVBUF
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   116
 *                                          SO_RCVBUF} </td>
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   117
 *     <td> The size of the socket receive buffer </td>
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   118
 *   </tr>
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   119
 *   <tr>
9679
d98ae8bc45fc 7042979: Rename StandardSocketOption and StandardWatchEventKind
alanb
parents: 5506
diff changeset
   120
 *     <td> {@link SctpStandardSocketOptions#SO_LINGER
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   121
 *                                          SO_LINGER} </td>
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   122
 *     <td> Linger on close if data is present (when configured in blocking mode
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   123
 *          only) </td>
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   124
 *   </tr>
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   125
 * </table>
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   126
 * </blockquote>
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   127
 * Additional (implementation specific) options may also be supported. The list
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   128
 * of options supported is obtained by invoking the {@link #supportedOptions()
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   129
 * supportedOptions} method.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   130
 *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   131
 * <p> SCTP multi channels are safe for use by multiple concurrent threads.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   132
 * They support concurrent sending and receiving, though at most one thread may be
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   133
 * sending and at most one thread may be receiving at any given time.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   134
 *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   135
 * @since 1.7
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   136
 */
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   137
public abstract class SctpMultiChannel
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   138
    extends AbstractSelectableChannel
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   139
{
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   140
    /**
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   141
     * Initializes a new instance of this class.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   142
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   143
     * @param  provider
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   144
     *         The selector provider for this channel
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   145
     */
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   146
    protected SctpMultiChannel(SelectorProvider provider) {
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   147
        super(provider);
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   148
    }
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   149
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   150
    /**
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   151
     * Opens an SCTP multi channel.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   152
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   153
     * <P> The new channel is unbound.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   154
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   155
     * @return  A new SCTP multi channel
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   156
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   157
     * @throws UnsupportedOperationException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   158
     *         If the SCTP protocol is not supported
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   159
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   160
     * @throws  IOException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   161
     *          If an I/O error occurs
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   162
     */
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   163
    public static SctpMultiChannel open() throws
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   164
        IOException {
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   165
        return new sun.nio.ch.SctpMultiChannelImpl((SelectorProvider)null);
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   166
    }
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   167
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   168
    /**
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   169
     * Returns the open associations on this channel's socket.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   170
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   171
     * <P> Only associations whose {@link AssociationChangeNotification.AssocChangeEvent#COMM_UP
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   172
     * COMM_UP} association change event has been received are included
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   173
     * in the returned set of associations. Associations for which a
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   174
     * {@link AssociationChangeNotification.AssocChangeEvent#COMM_LOST COMM_LOST} or {@link
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   175
     * AssociationChangeNotification.AssocChangeEvent#SHUTDOWN SHUTDOWN} association change
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   176
     * event have been receive are removed from the set of associations.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   177
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   178
     * <P> The returned set of associations is a snapshot of the open
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   179
     * associations at the time that this method is invoked.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   180
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   181
     * @return  A {@code Set} containing the open associations, or an empty
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   182
     *          {@code Set} if there are none.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   183
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   184
     * @throws  ClosedChannelException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   185
     *          If this channel is closed
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   186
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   187
     * @throws  IOException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   188
     *          If some other I/O error occurs
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   189
     */
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   190
    public abstract Set<Association> associations()
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   191
        throws IOException;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   192
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   193
    /**
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   194
     * Binds the channel's socket to a local address and configures the socket
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   195
     * to listen for connections.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   196
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   197
     * <P> This method is used to establish a relationship between the socket
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   198
     * and the local address. Once a relationship is established then
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   199
     * the socket remains bound until the channel is closed. This relationship
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   200
     * may not necesssarily be with the address {@code local} as it may be removed
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   201
     * by {@link #unbindAddress unbindAddress}, but there will always be at least one local
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   202
     * address bound to the channel's socket once an invocation of this method
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   203
     * successfully completes.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   204
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   205
     * <P> Once the channel's socket has been successfully bound to a specific
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   206
     * address, that is not automatically assigned, more addresses
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   207
     * may be bound to it using {@link #bindAddress bindAddress}, or removed
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   208
     * using {@link #unbindAddress unbindAddress}.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   209
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   210
     * <P> The backlog parameter is the maximum number of pending connections on
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   211
     * the socket. Its exact semantics are implementation specific. An implementation
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   212
     * may impose an implementation specific maximum length or may choose to ignore
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   213
     * the parameter. If the backlog parameter has the value {@code 0}, or a negative
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   214
     * value, then an implementation specific default is used.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   215
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   216
     * @param  local
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   217
     *         The local address to bind the socket, or {@code null} to
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   218
     *         bind the socket to an automatically assigned socket address
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   219
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   220
     * @param  backlog
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   221
     *         The maximum number number of pending connections
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   222
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   223
     * @return  This channel
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   224
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   225
     * @throws  ClosedChannelException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   226
     *          If this channel is closed
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   227
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   228
     * @throws  java.nio.channels.AlreadyBoundException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   229
     *          If this channel is already bound
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   230
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   231
     * @throws  java.nio.channels.UnsupportedAddressTypeException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   232
     *          If the type of the given address is not supported
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   233
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   234
     * @throws  SecurityException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   235
     *          If a security manager has been installed and its {@link
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   236
     *          java.lang.SecurityManager#checkListen(int) checkListen} method
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   237
     *          denies the operation
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   238
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   239
     * @throws  IOException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   240
     *          If some other I/O error occurs
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   241
     */
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   242
    public abstract SctpMultiChannel bind(SocketAddress local,
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   243
                                          int backlog)
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   244
        throws IOException;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   245
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   246
    /**
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   247
     * Binds the channel's socket to a local address and configures the socket
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   248
     * to listen for connections.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   249
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   250
     * <P> This method works as if invoking it were equivalent to evaluating the
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   251
     * expression:
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   252
     * <blockquote><pre>
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   253
     * bind(local, 0);
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   254
     * </pre></blockquote>
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   255
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   256
     * @param  local
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   257
     *         The local address to bind the socket, or {@code null} to
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   258
     *         bind the socket to an automatically assigned socket address
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   259
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   260
     * @return  This channel
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   261
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   262
     * @throws  ClosedChannelException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   263
     *          If this channel is closed
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   264
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   265
     * @throws  java.nio.channels.AlreadyBoundException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   266
     *          If this channel is already bound
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   267
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   268
     * @throws  java.nio.channels.UnsupportedAddressTypeException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   269
     *          If the type of the given address is not supported
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   270
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   271
     * @throws  SecurityException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   272
     *          If a security manager has been installed and its {@link
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   273
     *          java.lang.SecurityManager#checkListen(int) checkListen} method
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   274
     *          denies the operation
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   275
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   276
     * @throws  IOException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   277
     *          If some other I/O error occurs
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   278
     */
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   279
    public final SctpMultiChannel bind(SocketAddress local)
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   280
        throws IOException {
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   281
        return bind(local, 0);
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   282
    }
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   283
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   284
    /**
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   285
     * Adds the given address to the bound addresses for the channel's
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   286
     * socket.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   287
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   288
     * <P> The given address must not be the {@link
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   289
     * java.net.InetAddress#isAnyLocalAddress wildcard} address.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   290
     * The channel must be first bound using {@link #bind bind} before
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   291
     * invoking this method, otherwise {@link NotYetBoundException} is thrown.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   292
     * The {@link #bind bind} method takes a {@code SocketAddress} as its
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   293
     * argument which typically contains a port number as well as an address.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   294
     * Addresses subquently bound using this method are simply addresses as the
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   295
     * SCTP port number remains the same for the lifetime of the channel.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   296
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   297
     * <P> New associations setup after this method successfully completes
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   298
     * will be associated with the given address. Adding addresses to existing
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   299
     * associations is optional functionality. If the endpoint supports
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   300
     * dynamic address reconfiguration then it may send the appropriate message
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   301
     * to the peer to change the peers address lists.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   302
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   303
     * @param  address
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   304
     *         The address to add to the bound addresses for the socket
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   305
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   306
     * @return  This channel
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   307
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   308
     * @throws  ClosedChannelException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   309
     *          If this channel is closed
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   310
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   311
     * @throws  NotYetBoundException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   312
     *          If this channel is not yet bound
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   313
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   314
     * @throws  java.nio.channels.AlreadyBoundException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   315
     *          If this channel is already bound to the given address
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   316
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   317
     * @throws  IllegalArgumentException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   318
     *          If address is {@code null} or the {@link
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   319
     *          java.net.InetAddress#isAnyLocalAddress wildcard} address
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   320
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   321
     * @throws  IOException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   322
     *          If some other I/O error occurs
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   323
     */
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   324
    public abstract SctpMultiChannel bindAddress(InetAddress address)
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   325
         throws IOException;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   326
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   327
    /**
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   328
     * Removes the given address from the bound addresses for the channel's
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   329
     * socket.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   330
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   331
     * <P> The given address must not be the {@link
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   332
     * java.net.InetAddress#isAnyLocalAddress wildcard} address.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   333
     * The channel must be first bound using {@link #bind bind} before
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   334
     * invoking this method, otherwise {@link NotYetBoundException} is thrown.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   335
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   336
     * <P> If this method is invoked on a channel that does
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   337
     * not have {@code address} as one of its bound addresses, or that has only
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   338
     * one local address bound to it, then this method throws
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   339
     * {@link IllegalUnbindException}.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   340
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   341
     * <P> The initial address that the channel's socket is bound to using
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   342
     * {@link #bind bind} may be removed from the bound addresses for the
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   343
     * channel's socket.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   344
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   345
     * <P> New associations setup after this method successfully completes
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   346
     * will not be associated with the given address. Removing addresses from
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   347
     * existing associations is optional functionality. If the endpoint supports
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   348
     * dynamic address reconfiguration then it may send the appropriate message
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   349
     * to the peer to change the peers address lists.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   350
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   351
     * @param  address
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   352
     *         The address to remove from the bound addresses for the socket
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   353
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   354
     * @return  This channel
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   355
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   356
     * @throws  ClosedChannelException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   357
     *          If this channel is closed
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   358
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   359
     * @throws  NotYetBoundException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   360
     *          If this channel is not yet bound
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   361
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   362
     * @throws  IllegalUnbindException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   363
     *          {@code address} is not bound to the channel's socket, or the
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   364
     *          channel has only one address  bound to it
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   365
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   366
     * @throws  IllegalArgumentException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   367
     *          If address is {@code null} or the {@link
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   368
     *          java.net.InetAddress#isAnyLocalAddress wildcard} address
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   369
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   370
     * @throws  IOException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   371
     *          If some other I/O error occurs
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   372
     */
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   373
    public abstract SctpMultiChannel unbindAddress(InetAddress address)
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   374
         throws IOException;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   375
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   376
    /**
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   377
     * Returns all of the socket addresses to which this channel's socket is
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   378
     * bound.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   379
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   380
     * @return  All the socket addresses that this channel's socket is
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   381
     *          bound to, or an empty {@code Set} if the channel's socket is not
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   382
     *          bound
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   383
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   384
     * @throws  ClosedChannelException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   385
     *          If the channel is closed
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   386
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   387
     * @throws  IOException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   388
     *          If an I/O error occurs
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   389
     */
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   390
    public abstract Set<SocketAddress> getAllLocalAddresses()
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   391
        throws IOException;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   392
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   393
    /**
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   394
     * Returns all of the remote addresses to which the given association on
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   395
     * this channel's socket is connected.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   396
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   397
     * @return  All of the remote addresses for the given association, or
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   398
     *          an empty {@code Set} if the association has been shutdown
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   399
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   400
     * @throws  ClosedChannelException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   401
     *          If the channel is closed
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   402
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   403
     * @throws  IOException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   404
     *          If an I/O error occurs
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   405
     */
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   406
    public abstract Set<SocketAddress> getRemoteAddresses(Association association)
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   407
        throws IOException;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   408
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   409
    /**
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   410
     * Shutdown an association without closing the channel.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   411
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   412
     * @param  association
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   413
     *         The association to shutdown
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   414
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   415
     * @return  This channel
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   416
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   417
     * @throws  ClosedChannelException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   418
     *          If this channel is closed
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   419
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   420
     * @throws  IOException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   421
     *          If some other I/O error occurs
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   422
     */
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   423
    public abstract SctpMultiChannel shutdown(Association association)
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   424
            throws IOException;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   425
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   426
    /**
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   427
     * Returns the value of a socket option.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   428
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   429
     * <P> Note that some options are retrieved on the channel's socket,
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   430
     * therefore the {@code association} parameter is not applicable and will be
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   431
     * ignored if given. However, if the option is association specific then the
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   432
     * association must be given.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   433
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   434
     * @param  name
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   435
     *         The socket option
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   436
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   437
     * @param  association
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   438
     *         The association whose option should be retrieved, or {@code null}
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   439
     *         if this option should be retrieved at the channel's socket level.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   440
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   441
     * @return  The value of the socket option. A value of {@code null} may be
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   442
     *          a valid value for some socket options.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   443
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   444
     * @throws  UnsupportedOperationException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   445
     *          If the socket option is not supported by this channel
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   446
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   447
     * @throws  ClosedChannelException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   448
     *          If this channel is closed
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   449
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   450
     * @throws  IOException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   451
     *          If an I/O error occurs
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   452
     *
9679
d98ae8bc45fc 7042979: Rename StandardSocketOption and StandardWatchEventKind
alanb
parents: 5506
diff changeset
   453
     * @see SctpStandardSocketOptions
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   454
     */
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   455
    public abstract <T> T getOption(SctpSocketOption<T> name,
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   456
                                    Association association)
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   457
        throws IOException;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   458
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   459
    /**
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   460
     * Sets the value of a socket option.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   461
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   462
     * <P> Note that some options are retrieved on the channel's socket,
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   463
     * therefore the {@code association} parameter is not applicable and will be
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   464
     * ignored if given. However, if the option is association specific then the
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   465
     * association must be given.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   466
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   467
     * @param   name
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   468
     *          The socket option
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   469
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   470
     * @param  association
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   471
     *         The association whose option should be set, or {@code null}
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   472
     *         if this option should be set at the channel's socket level.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   473
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   474
     * @param   value
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   475
     *          The value of the socket option. A value of {@code null} may be
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   476
     *          a valid value for some socket options.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   477
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   478
     * @return  This channel
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   479
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   480
     * @throws  UnsupportedOperationException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   481
     *          If the socket option is not supported by this channel
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   482
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   483
     * @throws  IllegalArgumentException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   484
     *          If the value is not a valid value for this socket option
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   485
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   486
     * @throws  ClosedChannelException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   487
     *          If this channel is closed
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   488
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   489
     * @throws  IOException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   490
     *          If an I/O error occurs
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   491
     *
9679
d98ae8bc45fc 7042979: Rename StandardSocketOption and StandardWatchEventKind
alanb
parents: 5506
diff changeset
   492
     * @see SctpStandardSocketOptions
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   493
     */
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   494
    public abstract <T> SctpMultiChannel setOption(SctpSocketOption<T> name,
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   495
                                                   T value,
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   496
                                                   Association association)
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   497
         throws IOException;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   498
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   499
     /**
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   500
     * Returns a set of the socket options supported by this channel.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   501
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   502
     * <P> This method will continue to return the set of options even after the
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   503
     * channel has been closed.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   504
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   505
     * @return  A set of the socket options supported by this channel
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   506
     */
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   507
    public abstract Set<SctpSocketOption<?>> supportedOptions();
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   508
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   509
    /**
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   510
     * Returns an operation set identifying this channel's supported operations.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   511
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   512
     * <P> SCTP multi channels support reading, and writing, so this
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   513
     * method returns
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   514
     * {@code (}{@link SelectionKey#OP_READ} {@code |}&nbsp;{@link
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   515
     * SelectionKey#OP_WRITE}{@code )}.  </p>
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   516
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   517
     * @return  The valid-operation set
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   518
     */
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   519
    @Override
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   520
    public final int validOps() {
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   521
        return (SelectionKey.OP_READ |
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   522
                SelectionKey.OP_WRITE );
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   523
    }
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   524
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   525
    /**
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   526
     * Receives a message and/or handles a notification via this channel.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   527
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   528
     * <P> If a message or notification is immediately available, or if this
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   529
     * channel is in blocking mode and one eventually becomes available, then
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   530
     * the message or notification is returned or handled, respectively. If this
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   531
     * channel is in non-blocking mode and a message or notification is not
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   532
     * immediately available then this method immediately returns {@code null}.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   533
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   534
     * <P> If this method receives a message it is copied into the given byte
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   535
     * buffer and an {@link MessageInfo} is returned.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   536
     * The message is transferred into the given byte buffer starting at its
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   537
     * current position and the buffers position is incremented by the number of
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   538
     * bytes read. If there are fewer bytes remaining in the buffer than are
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   539
     * required to hold the message, or the underlying input buffer does not
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   540
     * contain the complete message, then an invocation of {@link
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   541
     * MessageInfo#isComplete isComplete} on the returned {@code
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   542
     * MessageInfo} will return {@code false}, and more invocations of this
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   543
     * method will be necessary to completely consume the messgae. Only
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   544
     * one message at a time will be partially delivered in any stream. The
9679
d98ae8bc45fc 7042979: Rename StandardSocketOption and StandardWatchEventKind
alanb
parents: 5506
diff changeset
   545
     * socket option {@link SctpStandardSocketOptions#SCTP_FRAGMENT_INTERLEAVE
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   546
     * SCTP_FRAGMENT_INTERLEAVE} controls various aspects of what interlacing of
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   547
     * messages occurs.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   548
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   549
     * <P> If this method receives a notification then the appropriate method of
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   550
     * the given handler, if there is one, is invoked. If the handler returns {@link
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   551
     * HandlerResult#CONTINUE CONTINUE} then this method will try to receive another
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   552
     * message/notification, otherwise, if {@link HandlerResult#RETURN RETURN} is returned
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   553
     * this method will return {@code null}. If an uncaught exception is thrown by the
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   554
     * handler it will be propagated up the stack through this method.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   555
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   556
     * <P> If a security manager has been installed then for each new association
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   557
     * setup this method verifies that the associations source address and port
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   558
     * number are permitted by the security manager's {@link
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   559
     * java.lang.SecurityManager#checkAccept(String,int) checkAccept} method.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   560
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   561
     * <P> This method may be invoked at any time. If another thread has
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   562
     * already initiated a receive operation upon this channel, then an
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   563
     * invocation of this method will block until the first operation is
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   564
     * complete. The given handler is invoked without holding any locks used
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   565
     * to enforce the above synchronization policy, that way handlers
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   566
     * will not stall other threads from receiving. A handler should not invoke
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   567
     * the {@code receive} method of this channel, if it does an
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   568
     * {@link IllegalReceiveException} will be thrown.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   569
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   570
     * @param  buffer
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   571
     *         The buffer into which bytes are to be transferred
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   572
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   573
     * @param  attachment
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   574
     *         The object to attach to the receive operation; can be
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   575
     *         {@code null}
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   576
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   577
     * @param  handler
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   578
     *         A handler to handle notifications from the SCTP stack, or
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   579
     *         {@code null} to ignore any notifications.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   580
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   581
     * @return  The {@code MessageInfo}, {@code null} if this channel is in
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   582
     *          non-blocking mode and no messages are immediately available or
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   583
     *          the notification handler returns {@code RETURN} after handling
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   584
     *          a notification
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   585
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   586
     * @throws  java.nio.channels.ClosedChannelException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   587
     *          If this channel is closed
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   588
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   589
     * @throws  java.nio.channels.AsynchronousCloseException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   590
     *          If another thread closes this channel
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   591
     *          while the read operation is in progress
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   592
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   593
     * @throws  java.nio.channels.ClosedByInterruptException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   594
     *          If another thread interrupts the current thread
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   595
     *          while the read operation is in progress, thereby
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   596
     *          closing the channel and setting the current thread's
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   597
     *          interrupt status
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   598
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   599
     * @throws  NotYetBoundException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   600
     *          If this channel is not yet bound
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   601
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   602
     * @throws  IllegalReceiveException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   603
     *          If the given handler invokes the {@code receive} method of this
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   604
     *          channel
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   605
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   606
     * @throws  SecurityException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   607
     *          If a security manager has been installed and it does not permit
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   608
     *          new associations to be accepted from the message's sender
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   609
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   610
     * @throws  IOException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   611
     *          If some other I/O error occurs
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   612
     */
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   613
    public abstract <T> MessageInfo receive(ByteBuffer buffer,
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   614
                                            T attachment,
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   615
                                            NotificationHandler<T> handler)
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   616
        throws IOException;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   617
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   618
    /**
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   619
     * Sends a message via this channel.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   620
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   621
     * <P> If this channel is unbound then this method will invoke {@link
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   622
     * #bind(SocketAddress, int) bind(null, 0)} before sending any data.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   623
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   624
     * <P> If there is no association existing between this channel's socket
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   625
     * and the intended receiver, identified by the address in the given messageInfo, then one
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   626
     * will be automatically setup to the intended receiver. This is considered
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   627
     * to be Implicit Association Setup. Upon successful association setup, an
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   628
     * {@link AssociationChangeNotification association changed}
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   629
     * notification will be put to the SCTP stack with its {@code event} parameter set
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   630
     * to {@link AssociationChangeNotification.AssocChangeEvent#COMM_UP COMM_UP}
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   631
     * . This notification can be received by invoking {@link #receive
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   632
     * receive}.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   633
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   634
     * <P> If this channel is in blocking mode, there is sufficient room in the
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   635
     * underlying output buffer, then the remaining bytes in the given byte
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   636
     * buffer are transmitted as a single message. Sending a message
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   637
     * is atomic unless explicit message completion {@link
9679
d98ae8bc45fc 7042979: Rename StandardSocketOption and StandardWatchEventKind
alanb
parents: 5506
diff changeset
   638
     * SctpStandardSocketOptions#SCTP_EXPLICIT_COMPLETE SCTP_EXPLICIT_COMPLETE}
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   639
     * socket option is enabled on this channel's socket.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   640
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   641
     * <P> If this channel is in non-blocking mode, there is sufficient room
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   642
     * in the underlying output buffer, and an implicit association setup is
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   643
     * required, then the remaining bytes in the given byte buffer are
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   644
     * transmitted as a single message, subject to {@link
9679
d98ae8bc45fc 7042979: Rename StandardSocketOption and StandardWatchEventKind
alanb
parents: 5506
diff changeset
   645
     * SctpStandardSocketOptions#SCTP_EXPLICIT_COMPLETE SCTP_EXPLICIT_COMPLETE}.
2542
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   646
     * If for any reason the message cannot
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   647
     * be delivered an {@link AssociationChangeNotification association
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   648
     * changed} notification is put on the SCTP stack with its {@code event} parameter set
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   649
     * to {@link AssociationChangeNotification.AssocChangeEvent#CANT_START CANT_START}.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   650
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   651
     * <P> The message is transferred from the byte buffer as if by a regular
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   652
     * {@link java.nio.channels.WritableByteChannel#write(java.nio.ByteBuffer)
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   653
     * write} operation.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   654
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   655
     * <P> If a security manager has been installed then for each new association
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   656
     * setup this method verifies that the given remote peers address and port
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   657
     * number are permitted by the security manager's {@link
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   658
     * java.lang.SecurityManager#checkConnect(String,int) checkConnect} method.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   659
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   660
     * <P> This method may be invoked at any time. If another thread has already
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   661
     * initiated a send operation upon this channel, then an invocation of
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   662
     * this method will block until the first operation is complete.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   663
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   664
     * @param  buffer
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   665
     *         The buffer containing the message to be sent
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   666
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   667
     * @param  messageInfo
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   668
     *         Ancillary data about the message to be sent
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   669
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   670
     * @return  The number of bytes sent, which will be either the number of
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   671
     *          bytes that were remaining in the messages buffer when this method
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   672
     *          was invoked or, if this channel is non-blocking, may be zero if
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   673
     *          there was insufficient room for the message in the underlying
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   674
     *          output buffer
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   675
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   676
     * @throws  InvalidStreamExcepton
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   677
     *          If {@code streamNumber} is negative, or if an association already
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   678
     *          exists and {@code streamNumber} is greater than the maximum number
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   679
     *          of outgoing streams
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   680
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   681
     * @throws  java.nio.channels.ClosedChannelException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   682
     *          If this channel is closed
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   683
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   684
     * @throws  java.nio.channels.AsynchronousCloseException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   685
     *          If another thread closes this channel
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   686
     *          while the read operation is in progress
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   687
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   688
     * @throws  java.nio.channels.ClosedByInterruptException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   689
     *          If another thread interrupts the current thread
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   690
     *          while the read operation is in progress, thereby
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   691
     *          closing the channel and setting the current thread's
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   692
     *          interrupt status
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   693
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   694
     * @throws  SecurityException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   695
     *          If a security manager has been installed and it does not permit
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   696
     *          new associations to be setup with the the messages's address
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   697
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   698
     * @throws  IOException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   699
     *          If some other I/O error occurs
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   700
     */
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   701
    public abstract int send(ByteBuffer buffer, MessageInfo messageInfo)
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   702
        throws IOException;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   703
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   704
    /**
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   705
     * Branches off an association.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   706
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   707
     * <P> An application can invoke this method to branch off an association
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   708
     * into a separate channel. The new bound and connected {@link SctpChannel}
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   709
     * will be created for the association. The branched off association will no
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   710
     * longer be part of this channel.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   711
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   712
     * <P> This is particularly useful when, for instance, the application
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   713
     * wishes to have a number of sporadic message senders/receivers remain
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   714
     * under the original SCTP multi channel but branch off those
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   715
     * associations carrying high volume data traffic into their own
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   716
     * separate SCTP channels.
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   717
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   718
     * @param  association
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   719
     *         The association to branch off
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   720
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   721
     * @return  The {@code SctpChannel}
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   722
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   723
     * @throws  java.nio.channels.ClosedChannelException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   724
     *          If this channel is closed
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   725
     *
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   726
     * @throws  IOException
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   727
     *          If some other I/O error occurs
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   728
     */
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   729
    public abstract SctpChannel branch(Association association)
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   730
        throws IOException;
d859108aea12 4927640: Implementation of the sctp protocol
chegar
parents:
diff changeset
   731
}