Thanks Mohan,
That's what I am seeing. I was thinking that callback will get called
for a bunch of data which comes at one instance (like 1 pkt). If I don't
read, the underneath CVI would not bother me again, but I know, I am wrong.
BTW - Why does CVI TCP fns. need this callback. Why not provide a way
where I can pass NULL for case I don't need the callback. That way I can
decide if I need to use callbacks or not (like RS232 library), rather
than forcing me.
vishi
Mohan wrote:
> Vishi,
>
> The TCP library calls the callback if there is ANY data to be read. So
> if you do not read the data, the library will keep calling your
> callback every time events are processed. This is the reason you see
> the printfs and the 100% CPU usage (basically the t
hread is very busy
> calling you callback again and again).
>
> To stop the callback being called again, read the data. Note that the
> callback will be called again if you have not read all the data, or if
> new data has arrived.
>
> Best regards,
> Mohan