Using Buffering with DataSocket Functions
- Updated2025-08-15
- 2 minute(s) read
Complete the following steps to enable client-side buffering using DataSocket functions. You must complete these steps for each client connection you establish.
- Open a data connection.
- Specify the buffer size for the data client.
- Read the buffered data a server writes.
- Monitor the buffer size.
- Close the data connection.
- Wire all error in and error out terminals on the block diagram.
You also can enable buffering when sharing data using the DataSocket functions by adding the string ?maxbytes=1000&maxpackets=10, to the end of the URL, where 1000 is the maximum number of bytes the buffer contains and 10 is the maximum number of packets the buffer contains.
Note Buffering applies only when you
use the DataSocket Read function
to read data a server writes. Buffering is not available when you use
front panel DataSocket data binding
to read data a server writes. Buffering is available for
front panel data binding
through the
Shared Variable Engine
if you bind controls to shared variables with buffering enabled on the
Network
page of the
Shared Variable Properties
dialog box.
The following example uses buffering with DataSocket functions.
Related Information
- Buffering Data
- Programmatically Opening and Closing Data Connections
- Specifying the Buffer Size Using DataSocket Functions
- Reading the Buffered Data a Server Writes
- Monitoring the Buffer Size of a Data Connection
- Setting up Error I/O in a VI
- Sharing Live Data Programmatically
- Reading Live Data Programmatically
- Reading Front Panel Data Using the dstp, opc, ftp, http, or file Protocol
- Reading and Writing Shared Variables with Controls and Indicators
- Understanding Shared Variable Technology