Class WebSocketHandler

  • All Implemented Interfaces:
    io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler
    Direct Known Subclasses:
    ShipClientHandler, ShipServerHandler

    public abstract class WebSocketHandler
    extends io.netty.channel.SimpleChannelInboundHandler<java.lang.Object>
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler

        io.netty.channel.ChannelHandler.Sharable
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected void checkDoubleConn​(java.lang.String peerSki)  
      abstract void close()  
      ShipConnection getConnection()  
      java.lang.String getPeerSki()  
      java.lang.String getRemoteAddr()  
      java.lang.String getRemoteHost()  
      protected int getTrustLevel()  
      protected void handlePingPongFrame​(io.netty.handler.codec.http.websocketx.WebSocketFrame frame)  
      protected byte[] handleWebSocketFrame​(io.netty.handler.codec.http.websocketx.WebSocketFrame frame)  
      protected boolean isPingPongFrame​(io.netty.handler.codec.http.websocketx.WebSocketFrame frame)  
      boolean isShipConnRdy​(int timeout)  
      protected void sendMsg​(byte[] msg)  
      • Methods inherited from class io.netty.channel.SimpleChannelInboundHandler

        acceptInboundMessage, channelRead, channelRead0
      • Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter

        channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
      • Methods inherited from class io.netty.channel.ChannelHandlerAdapter

        ensureNotSharable, handlerAdded, handlerRemoved, isSharable
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface io.netty.channel.ChannelHandler

        handlerAdded, handlerRemoved
    • Field Detail

      • log

        protected final org.slf4j.Logger log
      • ch

        protected io.netty.channel.Channel ch
      • shipConnRdyLatch

        protected java.util.concurrent.CountDownLatch shipConnRdyLatch
      • pongReceived

        protected boolean pongReceived
    • Method Detail

      • sendMsg

        protected void sendMsg​(byte[] msg)
      • isPingPongFrame

        protected boolean isPingPongFrame​(io.netty.handler.codec.http.websocketx.WebSocketFrame frame)
      • handlePingPongFrame

        protected void handlePingPongFrame​(io.netty.handler.codec.http.websocketx.WebSocketFrame frame)
      • handleWebSocketFrame

        protected byte[] handleWebSocketFrame​(io.netty.handler.codec.http.websocketx.WebSocketFrame frame)
      • getTrustLevel

        protected int getTrustLevel()
      • getPeerSki

        public java.lang.String getPeerSki()
      • getRemoteAddr

        public java.lang.String getRemoteAddr()
      • getRemoteHost

        public java.lang.String getRemoteHost()
      • checkDoubleConn

        protected void checkDoubleConn​(java.lang.String peerSki)
      • isShipConnRdy

        public boolean isShipConnRdy​(int timeout)
                              throws java.lang.InterruptedException
        Throws:
        java.lang.InterruptedException
      • close

        public abstract void close()