dotnetty heartbeat

IdleStateHandler needs to provide three parameters:

  • readerIdleTimeSeconds, read timeout. That is, when no data is read from the Channel within the specified event interval, an IdleStateEvent event of READER_IDLE will be triggered.

  • writerIdleTimeSeconds, write timeout. That is, when no data is written to the Channel within the specified event interval, an IdleStateEvent event of WRITER_IDLE will be triggered.

  • allIdleTimeSeconds, read/write timeout. That is, when there is no read or write operation within the specified event interval, an IdleStateEvent event of ALL_IDLE will be triggered.

Get client IP

   (InetSocketAddress)ctx.channel.remoteAddress

String clientIP = insocket.getAddress().getHostAddress();

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325285019&siteId=291194637