Say there is a TCP non-blocking socket which is continuously sending data without consuming incoming data, at some time the recv buffer will be filled and any packets received further will be discarded. But the peer socket is continuously consuming data so the send buffer has enough space in it.
What would be the behavior of this socket ? Will the send call pause and return EWOULDBLOCK when recv buffer is full. Or will the send succeed? if so how does the socket process the acknowledgment of sent packets.
Generally, the two "directions" in a TCP connection are independent. So even when the local (incoming) receive buffer is full, as long as there is space in peer's receive buffer, more data can be sent. The TCP "window" that is reported back to the sender is basically just the amount of free space in the peer's receive buffer. The peer will send back pure ACK packets (with no data payload) to report the available buffer space even if it can't send any data (due to its sending buffer/window being full).