LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to flush/clean TCP socket

Hello,

I need to implement a TCP socket cleaning/flushing to be sure it doesn´t contain any old/bad information.

The only way i have in mind is calling ClientTCPRead with the following parameteres, e.g.: dataSize = 4096, timeOut = 1

ClientTCPRead will be called several times while number of bytes read matches dataSize indicating there is still data (multiple of dataSize) in the TCP socket. Otherwise, if an error is returned, including timeout(-11), it will be exited.

The problem is that ClientTCPRead call lasts more than timeOut parameter (1 ms in this case) ranging from 1 ms to over 30 ms.

Is there a minimum of timeOut parameter? (i need to reduce this time)

Can TPC socket be flushed in other way?

Thanks in advance!

Alejandro 

0 Kudos
Message 1 of 2
(2,117 Views)

Hello AlePinto,

 

Can you please share your code?

 

Also, can you please tell me the final goal of the project?

0 Kudos
Message 2 of 2
(2,061 Views)