I know that a SocketChannel is "notified" about an orderly closed connection by receiving "-1" after calling read().
But how can it notify me about an disorderly closed connection? (as part of a whole NIO based server, working with selector and non-blocking socketChannels)
A write()
will throw IOException: connection reset
. Eventually. Due to TCP buffering it won't happen on the first write after the failure.