I have nice code to demonstrate NIO Selector from a book. But when I tried connect to this server second time my console hanged up.
Server code:
import