udi_channel_spawn(3udi)
Spawn a new channel
#include <udi.h>void udi_channel_spawn ( udi_channel_spawn_call_t *callback, udi_cb_t *gcb, udi_channel_t channel, udi_index_t spawn_idx, udi_index_t ops_idx, void *channel_context ); typedef void udi_channel_spawn_call_t ( udi_cb_t *gcb, udi_channel_t new_channel );ARGUMENTS callback, gcb are standard arguments described in the "Asynchronous Service Calls" section of "Calling Sequence and Naming Conventions"
channel is the channel handle for an existing anchored channel. The new channel will be spawned relative to this channel.
spawn_idx is a small integer which allows the environment to match two spawn requests (one from each end of the channel) together.
ops_idx is an ops index for the ops vector that the driver wants to associate with the specified channel, as indicated by the appropriate udi_ops_init_t in udi_init_info, or zero.
channel_context is a channel context pointer to be associated with the new anchored channel endpoint.
new_channel is the channel handle for the new channel's local endpoint, which will be a loose end. This handle must subsequently be passed to udi_channel_anchor, either in this region, or after passing it to another region via a channel operation.
WARNINGS Control block usage must follow the rules described in the "Asynchronous Service Calls" section of "Calling Sequence and Naming Conventions".
DESCRIPTION udi_channel_spawn is used to create a new channel (initially) between the same two regions as an existing channel. Both ends must be created separately by their own calls to udi_channel_spawn.
If ops_idx is zero, the channel endpoint is created as a loose end, which must be anchored before it can be used. Loose ends may be passed between regions, and even between drivers, before being anchored.
The pair of the original channel handle and the spawn index uniquely identify an in-progress spawn operation. The callback routine is called once the local end of the channel has been created and, if specified, anchored. The other region may or may not yet have completed its end of the spawn.
Drivers must ensure that both ends have completed spawning and are anchored and ready to go before invoking any operations on the channel. This is typically done via metalanguage-specific handshaking on the original channel.