cancel
Showing results for 
Search instead for 
Did you mean: 

neconn_write divide the transfer data

Agde.1
Associate III

Hi! I lm using lwip + freertos and STM32F429 and Cube IDE.

When I transfer 906B by netconn_write its transfer this data partly. I tried increase all possibiilities of defines but unsuccesssfull.

Please help who knows.

1 ACCEPTED SOLUTION

Accepted Solutions

Happy that your problem is solved.

Please click on the Select as Best button on my reply. This will help other members of the community find this solution more quickly.

Feel free to raise any issue or feedback.

Kind Regards,

Walid

View solution in original post

5 REPLIES 5

Hello @Agde.1​ ,

Make sure that the apiflags parameter of the netconn_write() macro is equal to NETCONN_DONTBLOCK.

#define netconn_write(conn, dataptr, size, apiflags) \

     netconn_write_partly(conn, dataptr, size, apiflags, NULL)

Below are the combination of apiflags parameter flags :

 * - NETCONN_COPY: data will be copied into memory belonging to the stack

 * - NETCONN_MORE: for TCP connection, PSH flag will be set on last segment sent

 * - NETCONN_DONTBLOCK: only write the data if all data can be written at once

I hope this solve your problem.

BeST Regards,

Walid

Agde.1
Associate III

Dear Walid!

Thank you for your replay!

The problem is in that I tried it at first and whith non blocking attribute netconn_write doesnt transfer any data when as with everyone else does

And I didnt understand why, still

Just as a reminder, TCP is a data stream (as opposed to UDP for example). The application should be able to reassemble the data and process it accordingly.

Otherwise, You could increase the Maximum segment size using this define TCP_MSS.

Take a look at this reference : https://lwip.fandom.com/wiki/Tuning_TCP#Maximum_segment_size_.28TCP_MSS.29

BeST Regards,

Walid

Agde.1
Associate III

Thank yout very much!

You was right!!!

Happy that your problem is solved.

Please click on the Select as Best button on my reply. This will help other members of the community find this solution more quickly.

Feel free to raise any issue or feedback.

Kind Regards,

Walid