com.sun.nio.sctp.IllegalReceiveException Java Examples

The following examples show how to use com.sun.nio.sctp.IllegalReceiveException. 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: 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 #2
Source File: Receive.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;

    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 #3
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 #4
Source File: Receive.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;

    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 #5
Source File: Receive.java    From openjdk-jdk8u-backup 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 #6
Source File: Receive.java    From openjdk-jdk9 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: Receive.java    From jdk8u-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 #8
Source File: Receive.java    From hottub 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 #9
Source File: Receive.java    From openjdk-8-source 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 #10
Source File: GitVcsRepository.java    From gradle-golang-plugin with Mozilla Public License 2.0 5 votes vote down vote up
@Override
public boolean isWorking() throws VcsException {
    try {
        return resolveRemoteRef() != null;
    } catch (final IllegalReceiveException ignored) {
        return false;
    } catch (final GitAPIException e) {
        throw new VcsException(e);
    }
}
 
Example #11
Source File: Receive.java    From openjdk-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;

    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 #12
Source File: Receive.java    From jdk8u_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 #13
Source File: Receive.java    From jdk8u-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 #14
Source File: Receive.java    From jdk8u-dev-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;
}