Reputation: 71
If I bind to a specific address/port is there a way to force it to unbind if no client has connected within a period of time and is there a way to be notified by a listener if there is an option?
Upvotes: 0
Views: 108
Reputation: 23567
There is nothing like this build in. That said you can do this by yourself. Just add a ChannelInboundHandlerAdapter
to the childHandler
method that overrides channelActive(...)
. Then schedule a timer that will check if this method was called within time X and if not close the Channel
.
Upvotes: 1