National Instruments 320682C Musical Toy Instrument User Manual


 
TCP Library Chapter 7
LabWindows/CVI Standard Libraries 7-10 © National Instruments Corporation
It is up to you to define the meaning of the callback data. The following are examples of how the
callback data can be used:
You can register your program as a TCP server multiple times under different port numbers.
You could use the same callback function for all of the server instances by using the callback
data to differentiate between them.
You can use the callback data to point to a data object that you need to access in the callback
function. In this way, you would not need to declare the data object as a global variable.
If you do not want to use the callback data, you can pass zero.
See Also
ConnectToTCPServer, UnregisterTCPServer
ServerTCPRead
int status = ServerTCPRead (unsigned int conversationHandle, void *dataBuffer,
unsigned int dataSize, unsigned int timeout);
Purpose
Reads data from a TCP client application.
Parameters
Input
conversationHandle
unsigned integer Uniquely identifies the
conversation.
dataBuffer
void pointer Buffer in which to receive data.
dataSize
unsigned integer Number of bytes to read.
timeout
unsigned integer Timeout in ms.
Return Value
status
integer Returns the number of bytes
written, or a negative error code
if an error occurs; Refer to error
codes in Table 7-3.
See Also
RegisterTCPServer, ServerTCPWrite