HP-UX C SIP Stack Programmer's Guide (Novembery 2007)

222 HP-UX C SIP Stack Programmers Guide
Sending Buffers with Transmitter Objects
RVSIP_TRANSMITTER_STATE_TERMINATED
This is the final state of the transmitter. When a transmitter is terminated, the
transmitter assumes the TERMINATED state. Upon reaching the
TERMINATED state, you can no longer reference the transmitter.
SENDING BUFFERS
WITH TRANSMITTER
O
BJECTS
A transmitter can be used for sending a non-SIP message to a specified
destination. For example, in some keep-alive mechanisms, the application is
required to send a buffer containing CRLF only to detect whether a connection
has failed. The RvSipTransmitterSendBuffer() function should be used for this
purpose.
To send a buffer
1. Create a buffer with the required content.
2. Create a new transmitter by calling
RvSipTransmitterMgrCreateTransmitter().
3. Set the required destination address to the transmitter by
calling RvSipTransmitterSetDestAddress(). The buffer will be
sent to this address.
4. Call RvSipTransmitterSendBuffer() and supply the required
buffer and buffer size.
Note There is no address resolution in the process of buffer sending. The
application must supply the transmitter with a real IP, transport and port before
calling RvSipTransmitterSendBuffer(). Otherwise this function will fail.
The Transmitter state machine is slightly changed when the transmitter is used
for sending a buffer and several states are omitted. Figure 11-2 shows the
Transmitter state machine for buffer sending.