Java NIO SocketChannel writing problem
- by Nilesh
I am using Java NIO's SocketChannel to write : int n = socketChannel.write(byteBuffer); Most of the times the data is sent in one or two parts; i.e. if the data could not be sent in one attemmpt, remaining data is retried.
The issue here is, sometimes, the data is not being sent completely in one attempt, rest of the data when tried to send multiple times, it occurs that even after trying several times, not a single character is being written to channel, finally after some time the remaning data is sent.
What could be the cause of such behaviour? Could external factors such as RAM, etc cause the hindarance?
Please help me solve this issue. If any other information is required please let me know.
Thanks