Can someone tell me how to set TCP send/receive buffer size under Solaris 2.5?
I have an application where a server sends data on either a signal
interrupt (A) or an alarm (B) on the same non-blocking stream socket.
So A & B continously send data over the socket. Occasionally a
problem occurs when the sequence is like this: A sends, B sends but
the receiving socket only got data from A and not B. In Richard
Stevens's Unix Network Programming Vol1 he indicated the following:
"With TCP the available room in the socket receive buffer is the
window that TCP advertises to the other end. The socket receive
buffer can not overflow because the peer isn't allowed to send data
beyond the advertised window. This is TCP flow control and if the
peer ignores the advertised window and sends data beyond the window,
the receiving TCP discards it".
Is this what happened in my case? If so is there a way for the
sending process to check the advertised window before sending to make
sure the sending data won't be discarded? If not is there a solution
to make sure the receiving TCP won't discard the data? Since data
from B is more important than data from A is there a way to flush the
receiving buffer before sending data from B to make sure the receiving
buffer will get the data from B?
Any help is much appreciated. Thanks in advance.