Stream Protocol Negotiation at Stream Creation Time
Following are some statements regarding stream protocol negotiation.
- The following flags are set to On in the negotiated
SPCB for the stream handler that should perform the action specified by
the flag. Either the source or the target negotiated SPCB will contain these
bit flags.
SPCBHAND_GENSYNC
SPCBHAND_GENTIME
The
DATATYPE_GENERIC will match any other data type during negotiation. This
is useful for stream handlers like the File System Stream Handler that can
be a source for almost any data type.
If
neither of the SPCB key data types are generic, then both the data type
and subtype fields must match or an error will occur. The internal key field
is not used during negotiation. The internal key of 0 is returned from negotiation.
The block size will default
to 1 byte if not specified. The source and target block size must match
or the negotiation will fail.
The
Data Buffer Size must be a multiple of block size.
The
negotiation will fail if one stream handler has a fixed buffer size (SPCBBUF_FIXEDBUF)
greater than the maximum buffer size (SPCBBUF_MAXSIZE) of the other.
Both
handlers must not have fixed buffer sizes (SPCBBUF_FIXEDBUF) of different
lengths.
Both handlers must
not have maximum buffer sizes (SPCBBUF_MAXSIZE) of different lengths.
Negotiation
will default to a fixed buffer size (SPCBBUF_FIXEDBUF). Otherwise, the buffer
size is set the greater of the two SPCB buffer sizes, but not greater than
the maximum buffer size (SPCBBUF_MAXSIZE), if one is specified.
If
no special conditions (SPCBBUF_FIXEDBUF,SPCBBUF_MAXSIZE,SPCBBUF_USERPROVIDED)
were specified, the largest buffer size is the one that will be used for
the stream creation.
For
user-provided buffers (SPCBBUF_USERPROVIDED), the buffer size is set to
the maximum buffer size (SPCBBUF_MAXSIZE), or to the largest buffers possible
rounded to a multiple of the block size.
Split
streams (SPCBBUF_INTERLEAVED) must have a maximum number of records per
buffer greater than 0. The target stream handler must set this field to
0, since only the source stream handler can set this value.
The
Minimum and Maximum number of buffers must be greater than zero.
The
largest Minimum number of buffers value is used.
The
largest Maximum number of buffers value is used.
The
Sync/Stream Manager attempts to allocate the maximum number of stream buffers
requested. If it is unable to allocate this amount of space, but is able
to allocate the minimum needed, the stream is created. Otherwise, the stream
creation fails for lack of resources.
The
number of EMPTY buffers required to start the source is always taken from
the source SPCB.
The number
of FULL buffers required to start the target is always taken from the target
SPCB.
For SpiGetTime requests,
each handler must specify whether it can receive these requests and return
real-time information. It can do this by specifying the SPCBHAND_GENTIME
flag. For negotiation, the target stream handler is the default provider
of this information unless only the source can provide this information.
The Bytes Per Unit and MMTIME
Per Unit are set from the stream handler that handles the real-time requests
per the previous statement.
For
sync pulses, each handler must specify whether it can send or receive sync
pulses. It can do this by specifying the SPCBHAND_GENSYNC or SPCBHAND_RCVSYNC
flag. For negotiation, the target stream handler is the default generator
and receiver of sync pulses unless only the source can generate and receive
sync pulses.
The sync tolerance
is only valid for handlers that set the SPCBHAND_RCVSYNC.
The
sync pulse granularity is only valid for handlers that set the SPCBHAND_GENSYNC.
The SPCBHAND_PHYS_SEEK flag
is used to specify if a stream handler does a physical device seek when
called on an SHC_SEEK call. The Sync/Stream Manager uses this information
to determine which stream handler should be called first on an SpiSeekStream
call. The handler that does a physical device seek will be called first,
otherwise, the stream handler that specified SPCBHAND_GENTIME will be called
last.
Any reserved fields
must be set to NULL.
Any
undefined bit in any bit flag of the stream protocol must be set to 0.
[Back: Stream Protocols]
[Next: Cuepoint Event Support]