In Java IO, an OutputStream
can use flush()
method to make sure data is sent at once.
Is there a corresponding function in Java NIO for SocketChannel
? As far as I know, there is a force()
method for FileChannel
to flush data.
Might be a very naive question...
Use either .force()
or .getFD.sync()
Update: Since you updated your question to be more specific on a SocketChannel (it was generally NIO), please see my reply instead.