Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1556 |
|
To create proxy clients, the ProxyStore class (which is derived from Client) is created instead of the Client class. The ProxyStore object that is created then acts as a repository for proxy clients. These proxy clients are simply objects derived from the Proxy base class. Once the initial setup is complete, the interface which is used for creating and managing these proxy clients is straight forward.
Figure § 15.2 shows a simple example of how proxy clients can be created. In this case, a particular proxy client, ProxyA, is created each time a make event is is sent to the client process. Messages are printed when the constructor, destructor, or Create function is called. In addition, any events (other than make) are responded to with the id of the proxy client in question. An interaction with this client would look something like:
- tp := client('tproxy') - one := tp->make() In ProxyA::Create Created a ProxyA: 21014:2:1 - two := tp->make() In ProxyA::Create Created a ProxyA: 21014:2:2 - three := tp->make() In ProxyA::Create Created a ProxyA: 21014:2:3 - print two->id() 2 - print three->id() 3 - two := 0 Deleted a ProxyA: 21014:2:2As you can see, the proxy clients behave just like any other client. Events can be sent to and received from them, and when they are deleted in the interpreter, their destructor is called in the client.