My code working fine till data buffer size 5840bytes.
But i need to write more data upto 20,000bytes. So that i can set the send buffer size WIP_COPT_SND_BUFSIZE = 20000 through setOpts function. but this function return error as “WIP_CERR_NOT_SUPPORTED”.
What is cause by this error arrives? What is the solution?
Once you’ve pushed 5.8KB to send, TCP buffers are full, you can’t stack more until these first 5.8KB are sent and acknowledged by the server, as requested by the TCP protocol. You’ll receive a WIP_CEV_WRITE message on the file’s event handler when some emission buffer space will have been freed. If you want, you can customize the minimal amount of buffer to get freed before you receive WIP_CEV_WRITE, by tuning WIP_COPT_SND_LOWAT with wip_setOpts(), refer to the doc for details.
Now, simply i want to know what is the “WIP_COPT_SND_BUFSIZE” maximum size?
This parameter prototype is u32 ( as on documentation). I am trying to set “WIP_COPT_SND_BUFSIZE” as 20,000 bytes for an my application requirement. Is this possible or not?
Your application requirement is to send a total of 20,000 bytes - that does not mean that you have to set the buffer size to 20,000 bytes!
In fact, I think it would be quite unusual to have such a large buffer!
As FFT explained, you would usually use a smaller buffer, and send your data in “chunks”…
what’s the negative value? (check return codes in wip_channel.h, type wip_error_t)
if you send your 20K just after your 13K, your issue is that 33K > 20K ==> increase buffer size or use WIP_CEV_WRITE messages. You might want to look at WIP_COPT_SND_LOWAT to control the moment at which the message is sent.
if you send them on different sockets, check the total amount of buffers allocated to the whole IP stack. If not suitable, tune it either with AT+WIPS or with wip_netInitOpts() depending on your WIP version (check the manual for details).