EG912Y ftp/tcp commands via USB port

Hello,
I am commanding (directly,it is a baremetal firmware) an EG912Y modem via USB port. The modem answers to my commands saying that data has been read properly. This is OK for short commands like AT, ATI. The problem comes when I try to send a lot of data via USB + transparent mode (tcp or ftp). In this case if I do not put a fixed delay (eg 100ms) between two different data transmit , the data does not reach the remote server (ftp or tcp): some data has lost. Is there a way (command, unsolicited code,…) to know when data has been properly transmitted to destination?
Thanks in advance for your time.
Best regards

Hello,
I have created an example which opens a TCP socket and sends packets of 512 bytes to it in transparent mode. The packet starts with the number of the packet. The USB write function succeed sending data to the modem, however on the remote server threre is a big jump in the received data …

67#############…(512 bytes ending with ‘X’)
68#############…(512 bytes ending with ‘X’)
69#############…(512 bytes ending with ‘X’)
70#############…(512 bytes ending with ‘X’) //HERE THE JUMP from 70 to 141 about 30KB…
141############…(512 bytes ending with ‘X’)
142############…(512 bytes ending with ‘X’)
143############…(512 bytes ending with ‘X’)
144############…(512 bytes ending with ‘X’)

This is strange: all the 512 bytes of the packet always arrive to the server. The modem loss entire packets.

Regards,
Alex

for the moment the only way to achieve the 100% packet transmission is give more time to the transmit function. This do not work well if network have poor signal ( the duration of transmit delay have to be function of signal strengh).
A better solution (I am working on) is to change the remote server code in order to inform the sender that data has been received properly.
Please le me know if there is a better solution.

Bes regards,
Alex