Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/com/sun/nio/sctp/SendFailedNotification.java
38924 views
/*1* Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/24package com.sun.nio.sctp;2526import java.nio.ByteBuffer;27import java.net.SocketAddress;2829/**30* Notification emitted when a send failed notification has been received.31*32* <P> A send failed notification indicates that a message cannot be delivered.33* Typically this is because the association has been shutdown with unsent data34* in the socket output buffer, or in the case of a {@link SctpMultiChannel}35* the association failed to setup.36*37* @since 1.738*/39@jdk.Exported40public abstract class SendFailedNotification implements Notification {41/**42* Initializes a new instance of this class.43*/44protected SendFailedNotification() {}4546/**47* Returns the association that this notification is applicable to.48*49* @return The association that failed to send, or {@code null} if50* there is no association, that is, the notification follows a51* {@linkplain52* com.sun.nio.sctp.AssociationChangeNotification.AssocChangeEvent#CANT_START}53*/54@Override55public abstract Association association();5657/**58* Returns the address.59*60* @return The peer primary address of the association or the address that61* the message was sent to62*/63public abstract SocketAddress address();6465/**66* Returns the data that was to be sent.67*68* @return The user data. The buffers position will be {@code 0} and its69* limit will be set to the end of the data.70*/71public abstract ByteBuffer buffer();7273/**74* Returns the error code.75*76* <P> The errorCode gives the reason why the send failed, and if set, will77* be a SCTP protocol error code as defined in RFC2960 section 3.3.1078*79* @return The error code80*/81public abstract int errorCode();8283/**84* Returns the stream number that the messge was to be sent on.85*86* @return The stream number87*/88public abstract int streamNumber();89}909192