Java Code Examples for com.sun.nio.sctp.HandlerResult#RETURN

The following examples show how to use com.sun.nio.sctp.HandlerResult#RETURN . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Send.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@Override
public HandlerResult handleNotification(
        AssociationChangeNotification notification, Void attachment) {
    AssocChangeEvent event = notification.event();
    Association association = notification.association();
    debug("AssociationChangeNotification");
    debug("  Association: " + notification.association());
    debug("  Event: " + event);

    if (event.equals(AssocChangeEvent.COMM_UP))
        receivedCommUp = true;

    this.maxInStreams = association.maxInboundStreams();
    this.maxOutStreams = association.maxOutboundStreams();

    return HandlerResult.RETURN;
}
 
Example 2
Source File: Send.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
@Override
public HandlerResult handleNotification(
        AssociationChangeNotification notification, Void attachment) {
    AssocChangeEvent event = notification.event();
    Association association = notification.association();
    debug("AssociationChangeNotification");
    debug("  Association: " + notification.association());
    debug("  Event: " + event);

    if (event.equals(AssocChangeEvent.COMM_UP))
        receivedCommUp = true;

    this.maxInStreams = association.maxInboundStreams();
    this.maxOutStreams = association.maxOutboundStreams();

    return HandlerResult.RETURN;
}
 
Example 3
Source File: Shutdown.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public HandlerResult handleNotification(
        ShutdownNotification sn, BooleanWrapper bool)
{
    bool.booleanValue(true);
    debug(sn.toString());
    return HandlerResult.RETURN;
}
 
Example 4
Source File: SocketOptionTests.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public HandlerResult handleNotification(
        AssociationChangeNotification notification, Object attachment) {
    AssocChangeEvent event = notification.event();
    debug("AssociationChangeNotification");
    debug("  Association: " + notification.association());
    debug("  Event: " + event);

    if (event.equals(AssocChangeEvent.COMM_UP))
        receivedCommUp = true;

    return HandlerResult.RETURN;
}
 
Example 5
Source File: Branch.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public HandlerResult handleNotification(
        ShutdownNotification notification, Object attachment) {
    debug("ShutdownNotification");
    debug("  Association: " + notification.association());

    fail("Shutdown should not be received");

    return HandlerResult.RETURN;
}
 
Example 6
Source File: Receive.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public HandlerResult handleNotification(
        AssociationChangeNotification notification, Object attachment) {
    AssocChangeEvent event = notification.event();
    debug("AssociationChangeNotification");
    debug("  Association: " + notification.association());
    debug("  Event: " + event);

    if (event.equals(AssocChangeEvent.COMM_UP))
        receivedCommUp = true;

    if (channel == null)
        return HandlerResult.RETURN;

    /* TEST 4: IllegalReceiveException - If the given handler invokes
     * the receive method of this channel*/
    ByteBuffer buffer = ByteBuffer.allocate(10);
    try {
        channel.receive(buffer, null, this);
        fail("IllegalReceiveException expected");
    } catch (IllegalReceiveException unused) {
        pass();
    } catch (IOException ioe) {
        unexpected(ioe);
    }

    return HandlerResult.CONTINUE;
}
 
Example 7
Source File: SocketOptionTests.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public HandlerResult handleNotification(
        AssociationChangeNotification notification, Object attachment) {
    AssocChangeEvent event = notification.event();
    debug("AssociationChangeNotification");
    debug("  Association: " + notification.association());
    debug("  Event: " + event);

    if (event.equals(AssocChangeEvent.COMM_UP))
        receivedCommUp = true;

    return HandlerResult.RETURN;
}
 
Example 8
Source File: Branch.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public HandlerResult handleNotification(
        AssociationChangeNotification notification, Object attachment) {
    AssocChangeEvent event = notification.event();
    debug("AssociationChangeNotification");
    debug("  Association: " + notification.association());
    debug("  Event: " + event);

    if (event.equals(AssocChangeEvent.COMM_UP))
        receivedCommUp = true;

    return HandlerResult.RETURN;
}
 
Example 9
Source File: Branch.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public HandlerResult handleNotification(
        AssociationChangeNotification notification, Object attachment) {
    AssocChangeEvent event = notification.event();
    debug("AssociationChangeNotification");
    debug("  Association: " + notification.association());
    debug("  Event: " + event);

    if (event.equals(AssocChangeEvent.COMM_UP))
        receivedCommUp = true;

    return HandlerResult.RETURN;
}
 
Example 10
Source File: Shutdown.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public HandlerResult handleNotification(
        ShutdownNotification sn, BooleanWrapper bool)
{
    bool.booleanValue(true);
    debug(sn.toString());
    return HandlerResult.RETURN;
}
 
Example 11
Source File: CommUp.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public HandlerResult handleNotification(
        ShutdownNotification notification, Object attachment) {
    debug("ShutdownNotification");
    debug("  Association: " + notification.association());
    return HandlerResult.RETURN;
}
 
Example 12
Source File: CommUp.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public synchronized HandlerResult handleNotification(
        AssociationChangeNotification notification, Object attachment) {
    AssocChangeEvent event = notification.event();
    debug("AssociationChangeNotification");
    debug("  Association: " + notification.association());
    debug("  Event: " + event);

    if (event.equals(AssocChangeEvent.COMM_UP)) {
        receivedCommUp = true;
        notifyAll();
    }

    return HandlerResult.RETURN;
}
 
Example 13
Source File: SocketOptionTests.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public HandlerResult handleNotification(
        AssociationChangeNotification notification, Object attachment) {
    AssocChangeEvent event = notification.event();
    debug("AssociationChangeNotification");
    debug("  Association: " + notification.association());
    debug("  Event: " + event);

    if (event.equals(AssocChangeEvent.COMM_UP))
        receivedCommUp = true;

    return HandlerResult.RETURN;
}
 
Example 14
Source File: Branch.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public HandlerResult handleNotification(
        ShutdownNotification notification, Object attachment) {
    debug("ShutdownNotification");
    debug("  Association: " + notification.association());

    fail("Shutdown should not be received");

    return HandlerResult.RETURN;
}
 
Example 15
Source File: Branch.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public HandlerResult handleNotification(
        AssociationChangeNotification notification, Object attachment) {
    AssocChangeEvent event = notification.event();
    debug("AssociationChangeNotification");
    debug("  Association: " + notification.association());
    debug("  Event: " + event);

    if (event.equals(AssocChangeEvent.COMM_UP))
        receivedCommUp = true;

    return HandlerResult.RETURN;
}
 
Example 16
Source File: Shutdown.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public HandlerResult handleNotification(
        ShutdownNotification sn, BooleanWrapper bool)
{
    bool.booleanValue(true);
    debug(sn.toString());
    return HandlerResult.RETURN;
}
 
Example 17
Source File: Receive.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public HandlerResult handleNotification(
        AssociationChangeNotification notification, Object attachment) {
    AssocChangeEvent event = notification.event();
    debug("AssociationChangeNotification");
    debug("  Association: " + notification.association());
    debug("  Event: " + event);

    if (event.equals(AssocChangeEvent.COMM_UP))
        receivedCommUp = true;

    if (channel == null)
        return HandlerResult.RETURN;

    /* TEST 4: IllegalReceiveException - If the given handler invokes
     * the receive method of this channel*/
    ByteBuffer buffer = ByteBuffer.allocate(10);
    try {
        channel.receive(buffer, null, this);
        fail("IllegalReceiveException expected");
    } catch (IllegalReceiveException unused) {
        pass();
    } catch (IOException ioe) {
        unexpected(ioe);
    }

    return HandlerResult.CONTINUE;
}
 
Example 18
Source File: CommUp.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public HandlerResult handleNotification(
        ShutdownNotification notification, Object attachment) {
    debug("ShutdownNotification");
    debug("  Association: " + notification.association());
    return HandlerResult.RETURN;
}
 
Example 19
Source File: CommUp.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public synchronized HandlerResult handleNotification(
        AssociationChangeNotification notification, Object attachment) {
    AssocChangeEvent event = notification.event();
    debug("AssociationChangeNotification");
    debug("  Association: " + notification.association());
    debug("  Event: " + event);

    if (event.equals(AssocChangeEvent.COMM_UP)) {
        receivedCommUp = true;
        notifyAll();
    }

    return HandlerResult.RETURN;
}
 
Example 20
Source File: SctpNotificationHandler.java    From netty-4.1.22 with Apache License 2.0 4 votes vote down vote up
@Override
public HandlerResult handleNotification(ShutdownNotification notification, Object o) {
    fireEvent(notification);
    sctpChannel.close();
    return HandlerResult.RETURN;
}