Call order
Previous Top Next

As you can see in the example files or in Getting started, this is the logic (call order) when using TCPServer UDF:

1.   Set parameters
2.   Set on events
3.   Start server
4.   Loop undefinitely to don't close the script (as when using GUIOnEventMode)

You mustn't forget, of course, to close the server when you need. However, closing the script already closes the server. You don't need to call TCPStartup() or TCPShutdown().