0

I have an application which communicates with another application using sockets with the send() and recv() functions. The connection is blocking - the application doesn't set the O_NONBLOCK flag. Moreover, send() doesn't use the MSG_DONTWAIT flag.

The communication works fine, but after some time send blocks. It means that there is no more space in the kernel buffer. Could you explain why/when this happens? Does calling the recv() function free the space in the kernel? Maybe one application reads the data slower than the other application is sending it?

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
Irbis
  • 1,432
  • 1
  • 13
  • 39
  • 3
    There's a limit to how many bytes can actually be in flight at a time. If the receiving end isn't reading, its own buffers will fill up, and it will close the receive window, stopping the sending end from sending more, hence the blocking. – Hasturkun Sep 06 '22 at 13:03

0 Answers0