![]() |
License / Documentation home / Help and feedback | ![]() |
MITRE offers a utility which bundles up some of the brokering information and slightly simplifies setting up a brokering connection. This utility involves three steps: defining type handlers for the broker, adding outgoing broker support, and adding incoming broker support.
The brokering example contains servers which illustrate this technique in addition to the technique support directly by the MIT API. This tool is completely compatible with the MIT API; it's possible to use the MITRE tools on one end of the connection and the MIT API on the other, and the MITRE tool works without the timed task loop in the same way as the MIT API does.
See the page on compiling and accessing these utilities.
typedef void (*MGal_BrokerDTHandler)(GalIO_BrokerStruct *broker_struct, void *data, int n_samples)
These type handlers should be registered in _GalSS_init_server:
void *_GalSS_init_server(GalIO_ServerStruct *s, int argc, char **argv)void MGal_AddBrokerDTHandler(Gal_ObjectType dt, void *val, MGal_BrokerDTHandler h)
{
MGal_AddBrokerDTHandler(GAL_STRING, (void *) AUDIO_SERVER_NEW_UTT,
audio_in_new_utt);
MGal_AddBrokerDTHandler(GAL_STRING, (void *) AUDIO_SERVER_SAMPLES_DONE,
audio_in_done);
MGal_AddBrokerDTHandler(GAL_STRING, (void *) AUDIO_SERVER_SAMPLES_ABORT,
audio_in_abort);
MGal_AddBrokerDTHandler(GAL_INT_16, (void *) NULL,
audio_in_int16_data);
return (void *) NULL;
}
GalIO_BrokerStruct *MGal_AddOutgoingBrokering(GalIO_CommStruct
*gcomm, Gal_Frame fr, int poll_ms, int timeout_ms)
The arguments for this function are identical
to those of GalIO_BrokerDataOutInit.
In addition, this function computes the :call_id and records the appropriate
host and port in the keys :broker_host and :broker_port.
![]() |
License / Documentation home / Help and feedback | ![]() |