The VisiBroker Pluggable Transport Interface is delivered as a library and a supporting header file:
• binpluggable<bitmode>_<p>r_<version>.dll on Windows
• lib/libpluggable<bitmode>_<p>r.so.<version> on Solaris and Linux
•
• where bitmode is 64 on 64 bit platforms, “p” refers to the standard C++ version, and “version” refers to the version of VisiBroker. The APIs of the library are exposed through the vptrans.h header file.If either of the above scenarios is a serious possibility, a reserved number should be obtained from the OMG. See the OMG FAQ on CORBA tags, available at ftp://ftp.omg.org/pub/docs/ptc/99–02–01.txt, for details. The minimum number of tags required should be reserved, bearing in mind that a set of tags may normally only be reserved once per year. It is recommended that the numbers only be reserved as the developed system nears deployment.Two examples are provided in the examples/pluggable directory that illustrates how a plug-in transport could be implemented and how it could be used by a CORBA application. The example makes use of TCP/IP as transport to lay emphasis on the interface itself rather than to explain the intricacies of a transport layer.The following interfaces, exposed in the vptrans.h header file, need to be implemented.This class represents a single connection between a server and a client. Whenever a program reads or writes to it, that data will be received or sent to one single peer endpoint on the remote side. When a client wants to send a request to a server, the ORB will look for a valid connection to that server and create one, if it does not exist, yet. The remote endpoint of the connection is setup using the given Profile of the server and communicating with the Listener (see “VISPTransListener and VISPTransListenerFactory”) on the server side. Besides general status information, this class also must either (a) provide a method to wait for data coming through the connection, that times out after a given number of seconds, or (b) use the ‘Pluggable Transport Bridge’ class to perform that function by signalling incoming data to the Bridge when it is available.The Factory class is used to create instances of the plug-in connection and needs to be registered with a registrar using the static VISPTransRegistrar::addTransport API.This class is used on the server-side code to wait for incoming connections and requests from clients. New connections and requests on existing connections are signaled to the ORB via the Pluggable Transport Interface’s Bridge class (see “VISPTransBridge class”).When a request is received on an existing connection, the connection goes through a ‘Dispatch Cycle’. The Dispatch Cycle starts when the connection delivers data to the transport layer. In this initial state, the arrival of this data must be signalled to the ORB via the Bridge (see “VISPTransBridge class”) and then the Listener ignores the connection until the Dispatch process is completed (in the mean time, the connection is said to be in the ‘dispatch state’). The connection is returned to the initial state when the ORB makes a call to the Listener’s completedData() method. During the dispatch state the ORB will read directly from the connection until all requests are exhausted, avoiding any overhead incurred by the Bridge-Listener communication.The factory instance as with the connection should return instances of the implemented plug-in listener and should be registered using VISPTransRegistrar::addTransportAPI.This class provides the functionality to convert between a transport-specific endpoint description and an IOP based IOR that can be exchanged with other CORBA implementations. It is also used during the process of binding a client to a server, by passing a ProfileValue to a ‘parsing’ function that has to return true or false, depending on whether an IOR usable for this transport was found inside of it.An instance of this class is frequently passed to functions via a pointer to its base class type. In order to support safe runtime down casting with any C++ compiler, a _downcast function must be provided that can test if the cast is legal or not.