2015-03-06 16:49 GMT+01:00 Mark Thomas <ma...@apache.org>: > I can see how both might be useful. No objections here. > > So in addition to my initial plan, I added some state information (NIO2 thinks it is a good idea to hide it), as well as flexibility for the completion handler call (NIO2 calls it as soon as it read or wrote anything, leading in most cases to boilerplate code to handle incomplete operations).
There's also no internal buffering and added sync since the caller should use what it needs there, the idea is to preparse the protocol in the IO on read and avoid dumb buffering copies on write. OTOH, with encryption the benefits go away to some extent (the NIO2 SSL would be improved though, it's not really representative at the moment) and the "test" will be if this is useful for HTTP/2. In that case it could be generalized, otherwise there will be no point keeping it. Rémy