TCP keep-alive to determine if client disconnected in netty

前端 未结 4 594
日久生厌
日久生厌 2020-12-05 11:48

I\'m trying to determine if a client has closed a socket connection from netty. Is there a way to do this?

4条回答
  •  没有蜡笔的小新
    2020-12-05 12:04

    It depends on your protocol that you use ontop of netty. If you design it to support ping-like messages, you can simply send those messages. Besides that, netty is only a pretty thin wrapper around TCP.

    Also see this SO post which describes isOpen() and related. This however does not solve the keep-alive problem.

提交回复
热议问题