Data Portability
|
The output of an os_bstream
is a stream of primitives sent to a specific device via an os_protocol
and an os_adapter . Because many types of devices
are supported, the reader of the data stream can be on another computer.
Use of sockets or sharing files between multiple computers are common cases where this occurs. To allow two different computer architectures, such as SPARC and Intel, to communicate in such situations, data portability must be assured.
With Streaming<ToolKit> you
can use different data protocols by providing a flexible protocol mechanism. A
protocol adapter is a data translation layer that translates between
platform-specific primitive data types and portable data representations. The
protocol interface is defined by the abstract base class os_protocol
, which is designed to be easily extensible.
By default, the os_bstream
class uses the Network Data Representation (NDR) protocol to binary encode
primitives. For information on how to build and use alternative protocols, refer
to the "Changing Protocols in the Universal Streaming Service" section
of this chapter. NDR is an efficient protocol, because of the negotiation
between the reader and the writer when the connection is initially established.
During this initialization phase, information about each side's memory
architecture, word size, and other values are exchanged in a predefined packet
known as a format label.
The format label enables each side to determine which data conversions, if any, are necessary to communicate with the other party.
Compare this approach to other protocols that require both the reader and the writer to convert primitives to a common, "neutral" data format.
All NDR protocol-specific data
translation is performed by the protocol adapter class os_ndr
.
Copyright©1994-2026 Recursion
Software LLC
All Rights Reserved - For use by licensed users only.