ChunkSize

Description

ChunkSize gets or sets the size (in bytes) of the buffer to submit to Winsock when receiving. Note that there is no guarantee that this is the size of data that will be returned.

Good to know: This property can only be changed if there are no connections, and will fail if passed a negative number.

Remarks

This property should be set to a size that is as large as your stack can (and typically does) receive at any one time, with the intention of not incurring two separate receives from Winsocks buffers because the buffers were too small to retrieve all available data at once. Note that data is dispatched to the application in sizes that they are received in, so setting the size to a large value such as 10,240 bytes and then running the application briefly and recording the size of data chunks received will allow a developer to determine roughly the appropriate ChunkSize to set. Note that very little overhead is incurred by having the buffer be a larger size since once the data has been received, it is stored (and then queued) in a buffer just large enough to hold the data, not the size indicated by the ChunkSize property. This property must be set after the ActivateWinsock method is called, but before and connections have been made or listening sockets opened

Data Type

LONG

Last updated