The samples directory in the SDK contains a number of simple programs, each of which demonstrates how to program some basic functionality using the Wiretap Client API. You can treat these programs as building blocks when you are developing your own Wiretap client: cut, paste, and adapt code from these samples into your own C++ program or Python module.
This section recommends two sample programs that you can read, build (for the C++ version), and run. They will help you become familiar with a few classes and ways of doing things using the Wiretap Client API. After you have done so, you can look at Programming Typical Workflows, which covers basic programming issues and goes into more depth on how to program a variety of workflows.
The Wiretap Client SDK includes a sample C++ program (listAllServers.C) and a Python module (listAllServers.py) that displays a list of all the Wiretap hosts on the network to which your development machine is connected.
The functionality shown in listAllServers.C is almost identical to that of the command line tool wiretap_server_dump.
When you examine the code in listAllServers, you will notice that it does the following:
All Wiretap clients must start with a call to the global function, WireTapClientInit or instantiate a WireTapClient guard object.
Wiretap uses network multicast technology to broadcast Wiretap server nodes to each other, allowing any Wiretap client to obtain a list of active servers. The Wiretap Client API silently finds one server on startup through which it gains knowledge of all others.
Your Wiretap client can populate a browser with any or all of the available information.
In your Wiretap client, you can use this WireTapServerId to instantiate a WireTapServerHandle which is a live connection to a particular Wiretap server and gives access to its node hierarchy.
All Wiretap clients must end with a call to the global function, WireTapClientUninit or destroy WireTapClient guard object if it was explicitly instantiated.
The Wiretap Client SDK includes a sample C++ program (listChilden.C) and a Python module (listChildren.py) that display a list of the child nodes of a particular node on a particular Wiretap server.
The functionality demonstrated in listChildren is almost identical to that of the command line tool wiretap_get_children.
When you examine the code in listChildren, you will notice that it does the following:
As explained earlier, if a Creative Finishing application is installed on your machine, the IFFFS Wiretap server is also installed, and usually it is running. In this case, the default localhost allows you to run listChildren.C. If the default value does not work, you can set the host as an environment variable or hard-code the name of a valid host.
All Wiretap clients must start with a call to the WireTapClientInit global function or instantiate a WireTapClient guard object.
An instance of WireTapServerHandle is an active connection to a particular Wiretap server and gives access to its node hierarchy.
The root node of an IFFFS Wiretap server is named /.
The children of the root node on an IFFFS Wiretap server are VOLUME type nodes. The default VOLUME node is usually named AutodeskMediaStorage. The sample program only gets one level of children.
Your Wiretap client can use these WireTapNodeHandle objects to populate a browser of the server’s node hierarchy. By nesting calls to getNumChildren and getChildNode, your client can drill down through the entire node hierarchy. You can allow the user of your Wiretap client to select the branch to view. For each node, you can display as much information as useful for the user.
All Wiretap clients must end with a call to the WireTapClientUninit global function or destroy the WireTapClient guard object..