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

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

Introduction

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

Prototype

AsciiString LOGIN

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

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;//  www  .  ja v a 2  s  . c o  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 w w . j  a  v a2 s  .  co 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);
}