Using libstomp is as simple as:
- Initializing APR
- Establishing a stomp connection
- Reading and writting simple stomp frames
- APR shutdown
See the libstomp Examples
The following snipplet of code initializes the APR runtime.
Establish the Stomp Connection
Here's what's required to establish the Stomp connection. Notice that an APR memory pool is used to allocate the connection.
Reading and Writting Simple Stomp Frames
A Stomp frame is made up of 3 parts: a command, a set of header properties, and a body. Here's how you can initialize the frame and write it to the connection.
To read a Stomp frame from the connection:
Closing a connection that was previously created with stomp_connect is done with:
Shutting down APR is simply done using: