com.sun.nio.sctp.AssociationChangeNotification.AssocChangeEvent Java Examples

The following examples show how to use com.sun.nio.sctp.AssociationChangeNotification.AssocChangeEvent. 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 hottub 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 openjdk-jdk8u-backup 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: Send.java    From jdk8u_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 #4
Source File: Send.java    From openjdk-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 #5
Source File: Send.java    From openjdk-jdk8u 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 #6
Source File: Send.java    From openjdk-jdk9 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 #7
Source File: Send.java    From jdk8u-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 #8
Source File: Send.java    From jdk8u60 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 #9
Source File: Send.java    From openjdk-8-source 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 #10
Source File: Send.java    From jdk8u-dev-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 #11
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 #12
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 #13
Source File: Send.java    From jdk8u-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 #14
Source File: SocketOptionTests.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;

    return HandlerResult.RETURN;
}
 
Example #15
Source File: Branch.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;

    return HandlerResult.RETURN;
}
 
Example #16
Source File: ReceiveIntoDirect.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;

    return HandlerResult.CONTINUE;
}
 
Example #17
Source File: SelectorThread.java    From sctp with GNU Affero General Public License v3.0 5 votes vote down vote up
private void finishConnectionTcp(SelectionKey key) throws IOException {

		AssociationImpl association = (AssociationImpl) key.attachment();

		try {
			SocketChannel socketChannel = (SocketChannel) key.channel();
			if (socketChannel.isConnectionPending()) {

				// TODO Loop? Or may be sleep for while?
				while (socketChannel.isConnectionPending()) {
					socketChannel.finishConnect();
				}
			}

			if (logger.isInfoEnabled()) {
				logger.info(String.format("Association=%s connected to=%s", association.getName(), socketChannel.getRemoteAddress()));
			}

			// Register an interest in writing on this channel
			key.interestOps(SelectionKey.OP_READ);

			AssocChangeEvent ace = AssocChangeEvent.COMM_UP;
			AssociationChangeNotification2 acn = new AssociationChangeNotification2(ace);
			association.associationHandler.handleNotification(acn, association);

		} catch (Exception e) {
			logger.error(String.format("Exception while finishing connection for Association=%s", association.getName()), e);

			association.scheduleConnect();
		}
	}
 
Example #18
Source File: CommUp.java    From jdk8u-dev-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 #19
Source File: SocketOptionTests.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;

    return HandlerResult.RETURN;
}
 
Example #20
Source File: CommUp.java    From jdk8u_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 #21
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 #22
Source File: CommUp.java    From hottub 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 #23
Source File: CommUp.java    From openjdk-8 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 #24
Source File: ReceiveIntoDirect.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;

    return HandlerResult.CONTINUE;
}
 
Example #25
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 #26
Source File: Branch.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;

    return HandlerResult.RETURN;
}
 
Example #27
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 #28
Source File: CommUp.java    From openjdk-8-source 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 #29
Source File: Branch.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;

    return HandlerResult.RETURN;
}
 
Example #30
Source File: SocketOptionTests.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;

    return HandlerResult.RETURN;
}