Interface MsgHandler

All Known Implementing Classes:
AmopMsgHandler, BlockNumberNotifyHandler, ChannelMsgHandler, EventPushMsgHandler, GetNodeVersionHandler, TransactionNotifyHandler

public interface MsgHandler
Message handler interface Each module which would like to get notified by the "network" module should implement this interface.
  • Method Summary

    Modifier and Type Method Description
    void onConnect​(io.netty.channel.ChannelHandlerContext ctx)
    OnConnect action.
    void onDisconnect​(io.netty.channel.ChannelHandlerContext ctx)
    OnDisconnect action Called when one connection disconnect.
    void onMessage​(io.netty.channel.ChannelHandlerContext ctx, Message msg)
    OnMessage action.
  • Method Details

    • onConnect

      void onConnect​(io.netty.channel.ChannelHandlerContext ctx)
      OnConnect action. Called when connect success.
      Parameters:
      ctx - ChannelHandlerContext of the connection from netty
    • onMessage

      void onMessage​(io.netty.channel.ChannelHandlerContext ctx, Message msg)
      OnMessage action. Called when one message comes from the network.
      Parameters:
      ctx - ChannelHandlerContext of the connection from netty
      msg - Message from the network
    • onDisconnect

      void onDisconnect​(io.netty.channel.ChannelHandlerContext ctx)
      OnDisconnect action Called when one connection disconnect.
      Parameters:
      ctx - ChannelHandlerContext of the connection from netty