BOOL TCPAdjustFIFOSize( TCP_SOCKET hTCP, WORD wMinRXSize, WORD wMinTXSize, BYTE vFlags );
This function can be used to adjust the relative sizes of the RX and TX FIFO depending on the immediate needs of an application. Since a larger FIFO can allow more data to be sent in a given packet, adjusting the relative sizes on the fly can allow for optimal transmission speed for one-sided application protocols. For example, HTTP typically begins by receiving large amounts of data from the client, then switches to serving large amounts of data back. Adjusting the FIFO at these points can increase performance substantially. Once the FIFO is adjusted, a window update is sent.
If neither or both of TCP_ADJUST_GIVE_REST_TO_TX and TCP_ADJUST_GIVE_REST_TO_RX are set, the function distributes the remaining space equally.
Received data can be preserved as long as the buffer is expanding and has not wrapped.
TCP is initialized.
Parameters |
Description |
hTCP |
The socket to be adjusted |
wMinRXSize |
Minimum number of byte for the RX FIFO |
wMinTXSize |
Minimum number of bytes for the RX FIFO |
vFlags |
Any combination of TCP_ADJUST_GIVE_REST_TO_RX, TCP_ADJUST_GIVE_REST_TO_TX, TCP_ADJUST_PRESERVE_RX. TCP_ADJUST_PRESERVE_TX is not currently supported. |
Return Values |
Description |
TRUE |
The FIFOs were adjusted successfully |
FALSE |
Minimum RX, Minimum TX, or flags couldn't be accommodated and therefore the socket was left unchanged. |
Any unacknowledged or untransmitted data in the TX FIFO is always deleted.
At least one byte must always be allocated to the RX buffer so that a FIN can be received. The function automatically corrects for this.