In java, Socket has a method setSoTimeout
that can be used to specify the reading
timeout, but there is no method to specify the writing
timeout
When I searched google, a lot of responses like "use nio and selectors
", it looks that SocketChannel
provides the way to specify the writing
timeout, I brief the code of this class, but I still didn't find out how to do it.
Could someone show some code or some guide? Thanks