I see.. looking at it in more detail, it could be that the other code is overly verbose, since the ch is a SocketChannel, and I guess if the channel gets closed the underlying socket will be too?