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

Working with the Transport Layer 287
Persistent Connection Handling
CONNECTION
C
APACITY PERCENT
RFC 3261 recommends that connections should be kept open for a period of
time after the last message was exchanged over the connection. However, the
exact time period to leave the connection open is defined by the implementation.
For example a fixed (location-wise) UA using a default outbound proxy can
leave the connection open forever, or until the proxy closes it.
The SIP Stack enables the application to leave client connections open even
after the connections are no longer in use (meaning that they do not have
owners). To achieve this, the application can use the connectionCapacityPercent
configuration parameter. The connectionCapacityPercent configuration
parameter determines the recommended percentage of opened connections that
the SIP Stack is allowed to hold at any given moment from its pool of
connections.
The SIP Stack is allowed to exceed the percentage of opened connections only if
all the opened connections are actually in use and have owners. When the
connectionCapacityPercent parameter is greater than 0, the SIP Stack will not
close connections that are no longer in use. Such connections will be kept in a
separate list and will remain open as long as their resources are not required.
Once the percentage of opened connections exceeds the allowed
connectionCapacityPercent, the SIP Stack will start closing connections from
this list each time it is required to open a new connection. A connection that is
kept in this list is not removed from the connection hash. Such a connection can
be located in the hash for usage and, in this case, will be removed from the list
and will no longer be a candidate for closure.
Since it is recommended to avoid resource problems for the creation of new
objects, and since connection closure is a process that takes time, it is highly
recommended to set the connectionCapacityPercent to an optimal value, smaller
than one hundred percent. This way the SIP Stack will always have available
resources for the creation of new connections.
APPLICATION
CONNECTIONS
The Persistent Connection feature lets the application open an application
connection and become the connection owner. Application connections are
handled as any other connections. They are inserted into the hash and can be
used by any SIP Stack object. As long as the application does not detach from an
application connection, the connection will have at least one owner (which is the
application) and therefore this connection will not be disconnected. Applications
might find it useful to open such connections to outbound proxies.
PERSISTENCY LEVELS The persistent connection feature of the SIP Stack offers three modes of
operation defined in the RvSipTransportPersistencyLevel enumeration: