Connecting to a Storyboard Application

In order to communicate with a running Storyboard application the external application must first attach to the application's Storyboard IO channel.  By default this channel is named after the deployment bundle file (i.e. [bundlename].gapp), however the name of this channel can be customized by specifying -ogreio,channel=newname as an option to sbengine. Alternatively, on some platforms, it is also possible to set a GREIONAME environment variable to the channel name.

Once the channel name is determined, the connection to the channel can be established with the gre_io_open() function. This will connect to the channel and return a handle that can be used for future communication.

Once the application has determined that no further communication is necessary the channel should be closed via the gre_io_close() function. The gre_io_close should be called in a manner that is serialized with clients using the handle returned from gre_io_open. For threaded applications where a receive thread is running independently, it is always a good idea to shut down and close the channel from within the thread that is receive blocked on the channel by sending it a specific termination message.

Was this article helpful?
0 out of 0 found this helpful