Multithreaded TCP Applications
The LabWindows/CVI TCP Support Library is multithread safe. In many applications, it makes sense to separate the TCP tasks from other tasks, such as user-interface management, by running the different tasks in different threads. You can design TCP servers that serve multiple clients simultaneously to process each client in a separate thread. This prevents one client from overloading the server and causing the server to exclude other clients. If one client issues a time-consuming task request, the server can continue to respond to other clients in the other threads. When designing multithreaded TCP programs, note that the TCP callback functions are called in the same thread in which RegisterTCPServerEx or ConnectToTCPServerEx are called. Therefore, that thread must process TCP events by calling RunUserInterface, ProcessSystemEvents, or ProcessTCPEvents.
Refer to the following examples that demonstrate multithreading and accepting requests from multiple clients in different threads.