Example usage for io.netty.handler.codec.stomp StompCommand CONNECT

List of usage examples for io.netty.handler.codec.stomp StompCommand CONNECT

Introduction

In this page you can find the example usage for io.netty.handler.codec.stomp StompCommand CONNECT.

Prototype

StompCommand CONNECT

To view the source code for io.netty.handler.codec.stomp StompCommand CONNECT.

Click Source Link

Usage

From source file:com.cmz.stomp.StompClientHandler.java

License:Apache License

@Override
public void channelActive(ChannelHandlerContext ctx) throws Exception {
    state = ClientState.AUTHENTICATING;//from  w ww. ja v  a2 s.co m
    StompFrame connFrame = new DefaultStompFrame(StompCommand.CONNECT);
    connFrame.headers().set(StompHeaders.ACCEPT_VERSION, "1.2");
    connFrame.headers().set(StompHeaders.HOST, StompClient.HOST);
    connFrame.headers().set(StompHeaders.LOGIN, StompClient.LOGIN);
    connFrame.headers().set(StompHeaders.PASSCODE, StompClient.PASSCODE);
    ctx.writeAndFlush(connFrame);
}

From source file:com.hop.hhxx.example.stomp.StompClientHandler.java

License:Apache License

@Override
public void channelActive(ChannelHandlerContext ctx) throws Exception {
    state = ClientState.AUTHENTICATING;//from  w ww . j  ava2s  .c  o  m
    StompFrame connFrame = new DefaultStompFrame(StompCommand.CONNECT);
    connFrame.headers().set(StompHeaders.ACCEPT_VERSION, "1.2");
    connFrame.headers().set(StompHeaders.HOST, io.netty.example.stomp.StompClient.HOST);
    connFrame.headers().set(StompHeaders.LOGIN, io.netty.example.stomp.StompClient.LOGIN);
    connFrame.headers().set(StompHeaders.PASSCODE, io.netty.example.stomp.StompClient.PASSCODE);
    ctx.writeAndFlush(connFrame);
}