Yuwen
Yuwen

Reputation: 973

How to close and clean the dead (zombie) connections?

If the client side lose its connection unexpectedly (may due to some network problems), the server may not notice this. This will lead to a dead connection which consumes some resource of the server if we don't detect it and clean it. 1. Would netty automatically detect this and clean it? If not, how to handle this problem? 2. How to close a connection if it is idle from the server side? If possible please provide some Java codes, thank you very much!

Upvotes: 0

Views: 1083

Answers (1)

forty-two
forty-two

Reputation: 12817

For 2) (and 1) as well, really), have a look at the IdleStateHandler provided by Netty.

Upvotes: 1

Related Questions