Java Code Examples for org.jboss.netty.channel.ChannelStateEvent

The following are top voted examples for showing how to use org.jboss.netty.channel.ChannelStateEvent. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: https-github.com-apache-zookeeper   File: NettyServerCnxnFactory.java   View source code 6 votes vote down vote up
@Override
public void channelConnected(ChannelHandlerContext ctx,
        ChannelStateEvent e) throws Exception
{
    if (LOG.isTraceEnabled()) {
        LOG.trace("Channel connected " + e);
    }

    NettyServerCnxn cnxn = new NettyServerCnxn(ctx.getChannel(),
            zkServer, NettyServerCnxnFactory.this);
    ctx.setAttachment(cnxn);

    if (secure) {
        SslHandler sslHandler = ctx.getPipeline().get(SslHandler.class);
        ChannelFuture handshakeFuture = sslHandler.handshake();
        handshakeFuture.addListener(new CertificateVerifier(sslHandler, cnxn));
    } else {
        allChannels.add(ctx.getChannel());
        addCnxn(cnxn);
    }
}
 
Example 2
Project: athena   File: OspfInterfaceChannelHandler.java   View source code 6 votes vote down vote up
@Override
public void channelDisconnected(ChannelHandlerContext ctx, ChannelStateEvent evt) {
    log.debug("OspfChannelHandler::channelDisconnected...!!!");

    for (Integer interfaceIndex : ospfInterfaceMap.keySet()) {
        OspfInterface anInterface = ospfInterfaceMap.get(interfaceIndex);
        if (anInterface != null) {
            anInterface.interfaceDown();
            anInterface.stopDelayedAckTimer();
        }
    }

    if (controller != null) {
        controller.connectPeer();
    }
}
 
Example 3
Project: athena   File: PcepChannelHandler.java   View source code 6 votes vote down vote up
@Override
public void channelDisconnected(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
    log.info("Pcc disconnected callback for pc:{}. Cleaning up ...", getClientInfoString());
    if (thispccId != null) {
        if (!duplicatePccIdFound) {
            // if the disconnected client (on this ChannelHandler)
            // was not one with a duplicate-dpid, it is safe to remove all
            // state for it at the controller. Notice that if the disconnected
            // client was a duplicate-ip, calling the method below would clear
            // all state for the original client (with the same ip),
            // which we obviously don't want.
            log.debug("{}:removal called", getClientInfoString());
            if (pc != null) {
                pc.removeConnectedClient();
            }
        } else {
            // A duplicate was disconnected on this ChannelHandler,
            // this is the same client reconnecting, but the original state was
            // not cleaned up - XXX check liveness of original ChannelHandler
            log.debug("{}:duplicate found", getClientInfoString());
            duplicatePccIdFound = Boolean.FALSE;
        }
    } else {
        log.warn("no pccip in channelHandler registered for " + "disconnected client {}", getClientInfoString());
    }
}
 
Example 4
Project: QoS-floodlight   File: OFChannelHandler.java   View source code 6 votes vote down vote up
@Override
@LogMessageDoc(message="Disconnected switch {switch information}",
               explanation="The specified switch has disconnected.")
public void channelDisconnected(ChannelHandlerContext ctx,
                                ChannelStateEvent e) throws Exception {
    controller.removeSwitchChannel(this);
    if (this.sw != null) {
        // TODO: switchDisconnected() will check if we've previously
        // activated the switch. Nevertheless, we might want to check
        // here as well.
        controller.switchDisconnected(this.sw);
        this.sw.setConnected(false);
    }

    log.info("Disconnected switch {}", getSwitchInfoString());
}
 
Example 5
Project: SecureKeeper   File: NettyServerCnxnFactory.java   View source code 6 votes vote down vote up
@Override
public void channelConnected(ChannelHandlerContext ctx,
        ChannelStateEvent e) throws Exception
{
    if (LOG.isTraceEnabled()) {
        LOG.trace("Channel connected " + e);
    }

    NettyServerCnxn cnxn = new NettyServerCnxn(ctx.getChannel(),
            zkServer, NettyServerCnxnFactory.this);
    ctx.setAttachment(cnxn);

    //SECUREKEEPER: Enable ssl only if specified
    //if (secure) {
    if(encryption.equals("ssl")){
        SslHandler sslHandler = ctx.getPipeline().get(SslHandler.class);
        ChannelFuture handshakeFuture = sslHandler.handshake();
        handshakeFuture.addListener(new CertificateVerifier(sslHandler, cnxn));
    } else {
        allChannels.add(ctx.getChannel());
        addCnxn(cnxn);
    }
}
 
Example 6
Project: SecureKeeper   File: NettyServerCnxnFactory.java   View source code 6 votes vote down vote up
@Override
public void channelConnected(ChannelHandlerContext ctx,
        ChannelStateEvent e) throws Exception
{
    if (LOG.isTraceEnabled()) {
        LOG.trace("Channel connected " + e);
    }

    NettyServerCnxn cnxn = new NettyServerCnxn(ctx.getChannel(),
            zkServer, NettyServerCnxnFactory.this);
    ctx.setAttachment(cnxn);

    //SECUREKEEPER: Enable ssl only if specified
    //if (secure) {
    if(encryption.equals("ssl")){
        SslHandler sslHandler = ctx.getPipeline().get(SslHandler.class);
        ChannelFuture handshakeFuture = sslHandler.handshake();
        handshakeFuture.addListener(new CertificateVerifier(sslHandler, cnxn));
    } else {
        allChannels.add(ctx.getChannel());
        addCnxn(cnxn);
    }
}
 
Example 7
Project: voyage   File: NettyRpcServerHandler.java   View source code 5 votes vote down vote up
@Override
public void channelOpen(ChannelHandlerContext ctx, ChannelStateEvent e)
		throws Exception {
	if (null != channelGroups) {
		channelGroups.add(e.getChannel());
	}
}
 
Example 8
Project: EatDubbo   File: NettyHandler.java   View source code 5 votes vote down vote up
@Override
public void channelConnected(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
    NettyChannel channel = NettyChannel.getOrAddChannel(ctx.getChannel(), url, handler);
    try {
        if (channel != null) {
            channels.put(NetUtils.toAddressString((InetSocketAddress) ctx.getChannel().getRemoteAddress()), channel);
        }
        handler.connected(channel);
    } finally {
        NettyChannel.removeChannelIfDisconnected(ctx.getChannel());
    }
}
 
Example 9
Project: EatDubbo   File: NettyHandler.java   View source code 5 votes vote down vote up
@Override
public void channelDisconnected(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
    NettyChannel channel = NettyChannel.getOrAddChannel(ctx.getChannel(), url, handler);
    try {
        channels.remove(NetUtils.toAddressString((InetSocketAddress) ctx.getChannel().getRemoteAddress()));
        handler.disconnected(channel);
    } finally {
        NettyChannel.removeChannelIfDisconnected(ctx.getChannel());
    }
}
 
Example 10
Project: fuck_zookeeper   File: NettyServerCnxnFactory.java   View source code 5 votes vote down vote up
@Override
public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e)
    throws Exception
{
    if (LOG.isTraceEnabled()) {
        LOG.trace("Channel closed " + e);
    }
    allChannels.remove(ctx.getChannel());
}
 
Example 11
Project: fuck_zookeeper   File: NettyServerCnxnFactory.java   View source code 5 votes vote down vote up
@Override
public void channelConnected(ChannelHandlerContext ctx,
        ChannelStateEvent e) throws Exception
{
    if (LOG.isTraceEnabled()) {
        LOG.trace("Channel connected " + e);
    }
    allChannels.add(ctx.getChannel());
    NettyServerCnxn cnxn = new NettyServerCnxn(ctx.getChannel(),
            zkServer, NettyServerCnxnFactory.this);
    ctx.setAttachment(cnxn);
    addCnxn(cnxn);
}
 
Example 12
Project: fuck_zookeeper   File: NettyServerCnxnFactory.java   View source code 5 votes vote down vote up
@Override
public void channelDisconnected(ChannelHandlerContext ctx,
        ChannelStateEvent e) throws Exception
{
    if (LOG.isTraceEnabled()) {
        LOG.trace("Channel disconnected " + e);
    }
    NettyServerCnxn cnxn = (NettyServerCnxn) ctx.getAttachment();
    if (cnxn != null) {
        if (LOG.isTraceEnabled()) {
            LOG.trace("Channel disconnect caused close " + e);
        }
        cnxn.close();
    }
}
 
Example 13
Project: dubbo2   File: NettyHandler.java   View source code 5 votes vote down vote up
@Override
public void channelConnected(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
    NettyChannel channel = NettyChannel.getOrAddChannel(ctx.getChannel(), url, handler);
    try {
        if (channel != null) {
            channels.put(NetUtils.toAddressString((InetSocketAddress) ctx.getChannel().getRemoteAddress()), channel);
        }
        handler.connected(channel);
    } finally {
        NettyChannel.removeChannelIfDisconnected(ctx.getChannel());
    }
}
 
Example 14
Project: dubbo2   File: NettyHandler.java   View source code 5 votes vote down vote up
@Override
public void channelDisconnected(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
    NettyChannel channel = NettyChannel.getOrAddChannel(ctx.getChannel(), url, handler);
    try {
        channels.remove(NetUtils.toAddressString((InetSocketAddress) ctx.getChannel().getRemoteAddress()));
        handler.disconnected(channel);
    } finally {
        NettyChannel.removeChannelIfDisconnected(ctx.getChannel());
    }
}
 
Example 15
Project: HiBangClient   File: ClientHandler.java   View source code 5 votes vote down vote up
@Override
public void channelConnected(ChannelHandlerContext ctx, ChannelStateEvent e)
		throws Exception {
	MyToast.ShowMessage(SMsgManage.getManager().getCurrContext(), e.toString());
	Log.i(ClientHandler.class.getName(), e.toString());
	super.channelConnected(ctx, e);
}
 
Example 16
Project: https-github.com-apache-zookeeper   File: NettyServerCnxnFactory.java   View source code 5 votes vote down vote up
@Override
public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e)
    throws Exception
{
    if (LOG.isTraceEnabled()) {
        LOG.trace("Channel closed " + e);
    }
    allChannels.remove(ctx.getChannel());
}
 
Example 17
Project: https-github.com-apache-zookeeper   File: NettyServerCnxnFactory.java   View source code 5 votes vote down vote up
@Override
public void channelDisconnected(ChannelHandlerContext ctx,
        ChannelStateEvent e) throws Exception
{
    if (LOG.isTraceEnabled()) {
        LOG.trace("Channel disconnected " + e);
    }
    NettyServerCnxn cnxn = (NettyServerCnxn) ctx.getAttachment();
    if (cnxn != null) {
        if (LOG.isTraceEnabled()) {
            LOG.trace("Channel disconnect caused close " + e);
        }
        cnxn.close();
    }
}
 
Example 18
Project: traccar-service   File: MainEventHandler.java   View source code 5 votes vote down vote up
@Override
public void channelDisconnected(ChannelHandlerContext ctx, ChannelStateEvent e) {
    Log.info(formatChannel(e.getChannel()) + " disconnected");
    closeChannel(e.getChannel());

    BaseProtocolDecoder protocolDecoder = (BaseProtocolDecoder) ctx.getPipeline().get("objectDecoder");
    if (ctx.getPipeline().get("httpDecoder") == null
            && !connectionlessProtocols.contains(protocolDecoder.getProtocolName())) {
        Context.getConnectionManager().removeActiveDevice(e.getChannel());
    }
}
 
Example 19
Project: dubbox-hystrix   File: NettyHandler.java   View source code 5 votes vote down vote up
@Override
public void channelConnected(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
    NettyChannel channel = NettyChannel.getOrAddChannel(ctx.getChannel(), url, handler);
    try {
        if (channel != null) {
            channels.put(NetUtils.toAddressString((InetSocketAddress) ctx.getChannel().getRemoteAddress()), channel);
        }
        handler.connected(channel);
    } finally {
        NettyChannel.removeChannelIfDisconnected(ctx.getChannel());
    }
}
 
Example 20
Project: dubbox-hystrix   File: NettyHandler.java   View source code 5 votes vote down vote up
@Override
public void channelDisconnected(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
    NettyChannel channel = NettyChannel.getOrAddChannel(ctx.getChannel(), url, handler);
    try {
        channels.remove(NetUtils.toAddressString((InetSocketAddress) ctx.getChannel().getRemoteAddress()));
        handler.disconnected(channel);
    } finally {
        NettyChannel.removeChannelIfDisconnected(ctx.getChannel());
    }
}
 
Example 21
Project: hadoop   File: ShuffleHandler.java   View source code 5 votes vote down vote up
@Override
public void channelOpen(ChannelHandlerContext ctx, ChannelStateEvent evt) 
    throws Exception {
  if ((maxShuffleConnections > 0) && (accepted.size() >= maxShuffleConnections)) {
    LOG.info(String.format("Current number of shuffle connections (%d) is " + 
        "greater than or equal to the max allowed shuffle connections (%d)", 
        accepted.size(), maxShuffleConnections));
    evt.getChannel().close();
    return;
  }
  accepted.add(evt.getChannel());
  super.channelOpen(ctx, evt);
 
}
 
Example 22
Project: hadoop   File: SimpleTcpClientHandler.java   View source code 5 votes vote down vote up
@Override
public void channelConnected(ChannelHandlerContext ctx, ChannelStateEvent e) {
  // Send the request
  if (LOG.isDebugEnabled()) {
    LOG.debug("sending PRC request");
  }
  ChannelBuffer outBuf = XDR.writeMessageTcp(request, true);
  e.getChannel().write(outBuf);
}
 
Example 23
Project: athena   File: OspfInterfaceChannelHandlerTest.java   View source code 5 votes vote down vote up
/**
 * Tests channelConnected() method.
 */
@Test(expected = Exception.class)
public void testChannelConnected() throws Exception {
    channelHandlerContext = EasyMock.createMock(ChannelHandlerContext.class);
    channelStateEvent = EasyMock.createMock(ChannelStateEvent.class);
    ospfInterfaceChannelHandler.channelConnected(channelHandlerContext, channelStateEvent);
}
 
Example 24
Project: athena   File: OspfInterfaceChannelHandlerTest.java   View source code 5 votes vote down vote up
/**
 * Tests channelDisconnected() method.
 */
@Test
public void testChannelDisconnected() throws Exception {
    channelHandlerContext = EasyMock.createMock(ChannelHandlerContext.class);
    channelStateEvent = EasyMock.createMock(ChannelStateEvent.class);
    ospfInterfaceChannelHandler.channelDisconnected(channelHandlerContext, channelStateEvent);
    assertThat(ospfInterfaceChannelHandler, is(notNullValue()));
}
 
Example 25
Project: athena   File: HandshakeTimeoutHandler.java   View source code 5 votes vote down vote up
@Override
public void channelOpen(ChannelHandlerContext ctx, ChannelStateEvent e)
        throws Exception {
    if (timeoutNanos > 0) {
        timeout = timer.newTimeout(new HandshakeTimeoutTask(ctx),
                                   timeoutNanos, TimeUnit.NANOSECONDS);
    }
    ctx.sendUpstream(e);
}
 
Example 26
Project: athena   File: HandshakeTimeoutHandler.java   View source code 5 votes vote down vote up
@Override
public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e)
        throws Exception {
    if (timeout != null) {
        timeout.cancel();
        timeout = null;
    }
}
 
Example 27
Project: athena   File: OFChannelHandler.java   View source code 5 votes vote down vote up
@Override
public void channelConnected(ChannelHandlerContext ctx,
        ChannelStateEvent e) throws Exception {
    channel = e.getChannel();
    log.info("New switch connection from {}",
            channel.getRemoteAddress());
    /*
        hack to wait for the switch to tell us what it's
        max version is. This is not spec compliant and should
        be removed as soon as switches behave better.
     */
    //sendHandshakeHelloMessage();
    setState(ChannelState.WAIT_HELLO);
}
 
Example 28
Project: athena   File: OFChannelHandler.java   View source code 5 votes vote down vote up
@Override
public void channelDisconnected(ChannelHandlerContext ctx,
        ChannelStateEvent e) throws Exception {
    log.info("Switch disconnected callback for sw:{}. Cleaning up ...",
            getSwitchInfoString());
    if (thisdpid != 0) {
        if (!duplicateDpidFound) {
            // if the disconnected switch (on this ChannelHandler)
            // was not one with a duplicate-dpid, it is safe to remove all
            // state for it at the controller. Notice that if the disconnected
            // switch was a duplicate-dpid, calling the method below would clear
            // all state for the original switch (with the same dpid),
            // which we obviously don't want.
            log.info("{}:removal called", getSwitchInfoString());
            if (sw != null) {
                sw.removeConnectedSwitch();
            }
        } else {
            // A duplicate was disconnected on this ChannelHandler,
            // this is the same switch reconnecting, but the original state was
            // not cleaned up - XXX check liveness of original ChannelHandler
            log.info("{}:duplicate found", getSwitchInfoString());
            duplicateDpidFound = Boolean.FALSE;
        }
    } else {
        log.warn("no dpid in channelHandler registered for "
                + "disconnected switch {}", getSwitchInfoString());
    }
}
 
Example 29
Project: athena   File: PcepChannelHandler.java   View source code 5 votes vote down vote up
@Override
public void channelConnected(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
    channel = e.getChannel();
    log.info("PCC connected from {}", channel.getRemoteAddress());

    // Wait for open message from pcc client
    setState(ChannelState.OPENWAIT);
}
 
Example 30
Project: athena   File: IsisChannelHandler.java   View source code 5 votes vote down vote up
@Override
public void channelDisconnected(ChannelHandlerContext ctx, ChannelStateEvent evt) {
    log.debug("IsisChannelHandler::channelDisconnected...!!!");
    if (controller != null) {
        controller.connectPeer();
        stopHelloSender();
    }
}
 
Example 31
Project: athena   File: IsisChannelHandlerTest.java   View source code 5 votes vote down vote up
@Before
public void setUp() throws Exception {
    controller = EasyMock.createNiceMock(Controller.class);
    isisProcess = EasyMock.createNiceMock(IsisProcess.class);
    channelHandlerContext = EasyMock.createNiceMock(ChannelHandlerContext.class);
    channelStateEvent = EasyMock.createNiceMock(ChannelStateEvent.class);
    exceptionEvent = EasyMock.createNiceMock(ExceptionEvent.class);
    messageEvent = EasyMock.createNiceMock(MessageEvent.class);
    isisMessage = EasyMock.createNiceMock(L1L2HelloPdu.class);
    isisMessage.setInterfaceIndex(2);
    isisChannelHandler = new IsisChannelHandler(controller, isisProcessList);
}
 
Example 32
Project: athena   File: FpmSessionHandler.java   View source code 5 votes vote down vote up
@Override
public void channelOpen(ChannelHandlerContext ctx, ChannelStateEvent e)
        throws Exception {
    if (!fpmListener.peerConnected(ctx.getChannel().getRemoteAddress())) {
        log.error("Received new FPM connection while already connected");
        ctx.getChannel().close();
        return;
    }

    channel = ctx.getChannel();
}
 
Example 33
Project: athena   File: BgpSession.java   View source code 5 votes vote down vote up
@Override
public void channelConnected(ChannelHandlerContext ctx,
                             ChannelStateEvent channelEvent) {
    localInfo.setAddress(ctx.getChannel().getLocalAddress());
    remoteInfo.setAddress(ctx.getChannel().getRemoteAddress());

    // Assign the local and remote IPv4 addresses
    InetAddress inetAddr;
    if (localInfo.address() instanceof InetSocketAddress) {
        inetAddr = ((InetSocketAddress) localInfo.address()).getAddress();
        localInfo.setIp4Address(Ip4Address.valueOf(inetAddr.getAddress()));
    }
    if (remoteInfo.address() instanceof InetSocketAddress) {
        inetAddr = ((InetSocketAddress) remoteInfo.address()).getAddress();
        remoteInfo.setIp4Address(Ip4Address.valueOf(inetAddr.getAddress()));
    }

    log.debug("BGP Session Connected from {} on {}",
              remoteInfo.address(), localInfo.address());
    if (!bgpSessionManager.peerConnected(this)) {
        log.debug("Cannot setup BGP Session Connection from {}. Closing...",
                  remoteInfo.address());
        ctx.getChannel().close();
    }

    //
    // Assign the local BGP ID
    // NOTE: This should be configuration-based
    //
    localInfo.setBgpId(bgpSessionManager.getMyBgpId());
}
 
Example 34
Project: athena   File: BgpSession.java   View source code 5 votes vote down vote up
@Override
public void channelDisconnected(ChannelHandlerContext ctx,
                                ChannelStateEvent channelEvent) {
    log.debug("BGP Session Disconnected from {} on {}",
              ctx.getChannel().getRemoteAddress(),
              ctx.getChannel().getLocalAddress());
    processChannelDisconnected();
}
 
Example 35
Project: athena   File: TestBgpPeerChannelHandler.java   View source code 5 votes vote down vote up
@Override
public void channelConnected(ChannelHandlerContext ctx,
                             ChannelStateEvent channelEvent) {
    this.savedCtx = ctx;
    // Prepare and transmit BGP OPEN message
    ChannelBuffer message = BgpOpen.prepareBgpOpen(localInfo);
    ctx.getChannel().write(message);

    // Prepare and transmit BGP KEEPALIVE message
    message = BgpKeepalive.prepareBgpKeepalive();
    ctx.getChannel().write(message);
}
 
Example 36
Project: ZooKeeper   File: NettyServerCnxnFactory.java   View source code 5 votes vote down vote up
@Override
public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e)
    throws Exception
{
    if (LOG.isTraceEnabled()) {
        LOG.trace("Channel closed " + e);
    }
    allChannels.remove(ctx.getChannel());
}
 
Example 37
Project: ZooKeeper   File: NettyServerCnxnFactory.java   View source code 5 votes vote down vote up
@Override
public void channelConnected(ChannelHandlerContext ctx,
        ChannelStateEvent e) throws Exception
{
    if (LOG.isTraceEnabled()) {
        LOG.trace("Channel connected " + e);
    }
    allChannels.add(ctx.getChannel());
    NettyServerCnxn cnxn = new NettyServerCnxn(ctx.getChannel(),
            zkServer, NettyServerCnxnFactory.this);
    ctx.setAttachment(cnxn);
    addCnxn(cnxn);
}
 
Example 38
Project: ZooKeeper   File: NettyServerCnxnFactory.java   View source code 5 votes vote down vote up
@Override
public void channelDisconnected(ChannelHandlerContext ctx,
        ChannelStateEvent e) throws Exception
{
    if (LOG.isTraceEnabled()) {
        LOG.trace("Channel disconnected " + e);
    }
    NettyServerCnxn cnxn = (NettyServerCnxn) ctx.getAttachment();
    if (cnxn != null) {
        if (LOG.isTraceEnabled()) {
            LOG.trace("Channel disconnect caused close " + e);
        }
        cnxn.close();
    }
}
 
Example 39
Project: iTAP-controller   File: AbstractRPCChannelHandler.java   View source code 5 votes vote down vote up
@Override
public void channelConnected(ChannelHandlerContext ctx,
                             ChannelStateEvent e) throws Exception {
    channelState = ChannelState.CONNECTED;

    HelloMessage m = new HelloMessage();
    if (getLocalNodeId() != null)
        m.setNodeId(getLocalNodeId());
    AsyncMessageHeader header = new AsyncMessageHeader();
    header.setTransactionId(getTransactionId());
    m.setHeader(header);
    switch (getAuthScheme()) {
        case NO_AUTH:
            channelState = ChannelState.AUTHENTICATED;
            m.setAuthScheme(org.sdnplatform.sync.thrift.
                            AuthScheme.NO_AUTH);
            break;
        case CHALLENGE_RESPONSE:
            AuthChallengeResponse cr = new AuthChallengeResponse();
            cr.setChallenge(generateChallenge());
            m.setAuthScheme(org.sdnplatform.sync.thrift.
                            AuthScheme.CHALLENGE_RESPONSE);
            m.setAuthChallengeResponse(cr);
            break;
    }
    SyncMessage bsm = new SyncMessage(MessageType.HELLO);
    bsm.setHello(m);
    ctx.getChannel().write(bsm);
}
 
Example 40
Project: iTAP-controller   File: HandshakeTimeoutHandler.java   View source code 5 votes vote down vote up
@Override
public void channelOpen(ChannelHandlerContext ctx, ChannelStateEvent e)
        throws Exception {
    if (timeoutNanos > 0) {
        timeout = timer.newTimeout(new HandshakeTimeoutTask(ctx), 
                                   timeoutNanos, TimeUnit.NANOSECONDS);
    }
    ctx.sendUpstream(e);
}