Frustimon
Frustimon

Reputation: 15

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?

Upvotes: 1

Views: 71

Answers (1)

user207421
user207421

Reputation: 310915

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.

Upvotes: 1

Related Questions