Example usage for io.netty.handler.codec.stomp StompHeaders HOST

List of usage examples for io.netty.handler.codec.stomp StompHeaders HOST

Introduction

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

Prototype

AsciiString HOST

To view the source code for io.netty.handler.codec.stomp StompHeaders HOST.

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;// w w  w.j av a 2  s  .c om
    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;/* w ww.  j  a  va2s  .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);
}