Is the maximum transmit length in sock_fastwrite() is 2048 bytes?

Trying to send more than 2048 bytes with using one sock_fastwrite(). However, only 2048 bytes are sent. These 2048 bytes are broken into 1460 bytes and 588 bytes in TCP.

Tried to set the len to 3000 (the 3rd parameter in sock_fastwrite which specified as “Maximum number of bytes to write to the socket” in Dynamic C TCPIP manual). But still getting the same result.

How can I send data with larger size with sock_fastwrite()?

There’s going to be a maximum, and it might change depending on the state of the TCP/IP stack.

As mentioned in the documentation for sock_fastwrite(), it “write up to len bytes”. Use the return value to determine how many bytes weren’t written, and repeatedly call sock_fastwrite() until you’ve written them all.

It looks like the limit is based on how much space is available in the write buffer for the socket. If you increase the buffer, you’ll be able to write more, but you’ll still need to write your code to handle the case where it writes fewer bytes than you requested.

I tried to call sock_fastwrite() multiple times but still seeing only 2048 bytes sent.

Now what I do is to add tcp_tick() after each sock_fastwrite() when doing multiple call. Then I am able to sent bytes more than 2048 bytes.

Is there any different between tcp_tick(socket) and tcp_tick(NULL)?

tcp_tick(socket) is deprecated and you can just call tcp_tick(NULL). You need those calls to process data in the TCP buffers.