This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TCP send without enough free buffer

Hi,

I'm having a problem that the send() (DSP sending data to PC) operation using TCP socket is blocking sometimes and I think it's because the buffer is full.

According to the NDK API Reference Guide (SPRU524H) about send(),

"If there is not transmit buffer space available on a stream type socket, the function waits
for space to become available, unless the socket is non-blocking."

Is there a way to know how much buffer space is available? This way if I want to send 1KB and there's only 512 bytes available I wouldn't try to send data and let it block.

Using a non-blocking socket would solve the problem?

Thanks