LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Server/Client TCPRead

Hello,
I tried your solution, it doesn't work,
The FP specifies that NULL is not allowed as a pointer to the buffer.
When I try with NULL, Iget a FATAL RUN-TIME ERROR Null pointer argument to
librairy function.
Any other idea?
Thanks ,
Marco

> "Shiner" a écrit dans le message de
> news:50650000000500000004350100-1066448259000@exchange.ni.com...
> > You do it using two calls to the Read Function.
> >
> > You can pass NULL as the pointer to your buffer in the first call, and
> > that will return the size of the buffer.
> >
> > You can then allocate the required space and in a second call, pass
> > the pointer to that buffer.
> >
> > Hope this helps
> >
> > Chris
>
Hi,
When using Server or ClientTCPRead functions, I need to pass
a buffer and
the size of the buffer (i.e maximum number of bytes to read).
How do I know if this buffer is large enough for the amount of data waiting
to be read?
In other words,
-I know each time data is ready to be read (when I get a TCP_DATAREADY
event).
-How do I know the lenght of the data?

If I pass a buffer too small, I will miss some data.
If I pass a buffer too big, will the TCPRead function return as soon as it
gets the last byte?
or will it wait until it gets the specified lenght and finally return after
the timeout period because it didn't receive the expected number of bytes?

Is there a way to know how many bytes are waiting to be read? Something
analog to GetInQLen (Rs232 library)

Best Regards,
Marco



>
0 Kudos
Message 1 of 1
(2,418 Views)