Frustimon Frustimon - 1 year ago 64
Java Question

Getting the remaining free space length on DatagramSocket's receive buffer in Java

So we are developing a transport protocol based on UDP. One characteristic of the expected output is that it should have reliable data transfer. A requirement of which is that the protocol should have flow control. Because of this, the remaining free space on the receiving buffer of DatagramSocket calls the need to be monitored. However, I do not find such method in the javadoc of the said class. Is there any way to determine the free space left in the receiving buffer?

EJP EJP
Answer Source

You are correct. There is no such method in the Java API. There is a socket option for it at the C level in some but not all operating systems.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download