09-12-2017 09:38 AM
But it is weird because I have the good size, the good first value in the message but it cuts somewhere in the message sent. I will try to find the reason. Thanks.
09-12-2017 02:49 PM
I generally break very large data into chunks when sending it over TCP. The largest chunk I generally use would be 65535. Simply put your TCP writes in a loop and send the data in pieces.
09-13-2017 12:01 AM
@Mark_Yedinak wrote:
I generally break very large data into chunks when sending it over TCP. The largest chunk I generally use would be 65535. Simply put your TCP writes in a loop and send the data in pieces.
To duplicate my post in OP's other thread, I'm not aware of any limitation with how much data a single TCP write function can send. The primitive or the OS is already going to break data apart for you into <1500 byte chunks.
However, if you put a timeout of 0 (as OP did), yes, you need to limit the size of your messages because you're asking it to never wait. What I personally do (if this sort of thing matters at all, which is pretty rare) is take the size of the data string and multiply it by expected transmit rate + overhead. So for example a cRIO would be 100 mbps, and I assume ~10 ms of overhead, and that gives me a timeout of X.
The other area where the 65k limit is correct is with UDP. UDP has a max packet size of 65k, so sending a packet bigger than that is impossible. Sending a packet bigger than a few MTUs is also not recommended, as each component of the packet is sent as an individual <1500 byte IP packet, and if any packet is lost the entire UDP packet is lost.
09-13-2017 04:01 AM - edited 09-13-2017 04:02 AM
It is working !!!!
I separate my data to send only a row at the time, and now I have no more problem.
I add my VI and python code to this post in future people have the same issue.
Again thank you all for your help and discussion.