TCPAdjustFIFOSize Function

Microchip TCP/IP Stack

Microchip TCP/IP Stack Help
TCPAdjustFIFOSize Function
C
BOOL TCPAdjustFIFOSize(
    TCP_SOCKET hTCP, 
    WORD wMinRXSize, 
    WORD wMinTXSize, 
    BYTE vFlags
);
Description

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.

Preconditions

TCP is initialized.

Parameters
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 
Return Values
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. 
Side Effects

Any unacknowledged or untransmitted data in the TX FIFO is always deleted.

Remarks

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.

Microchip TCP/IP Stack 5.42.08 - June 15, 2013
Copyright © 2012 Microchip Technology, Inc.  All rights reserved.