#include <nwnet.h> or #include <nwdsbuft.h>NWDSCCODE N_API NWDSAllocBuf (size_t size, ppBuf_T buf);
size is the size of buffer to allocate. The following two message sizes are defined in NWDSDC.H:
4096 DEFAULT_MESSAGE_LEN
64512 MAX_MESSAGE_LEN
The total bytes allocated for the buffer is size+sizeof(Buf_T).
For most operations, the size of DEFAULT_MESSAGE_LEN can be used. It is up to the developer to determine by experimentation if another size optimizes an application's performance.
When determining a buffer size, keep in mind the effects of buffer size. A smaller buffer means multiple iterations of an operation might need to be performed to retrieve all of the operation's results. On the other hand, using a large buffer might allow the operation to be completed in one step, but cause a significant delay for the user.
If NWDSAllocBuf is successful, buf is set to point to the allocated buffer.
Directory