Add API to register callback to set socket options
The registered callback function will be called before connect() is called on the socket, allowing tweaking of much more than just keepalive settings. This deprecates xmpp_conn_set_keepalive(). Includes helper/example callback function to set default keepalive parameters that some library users may find useful.
This commit is contained in:
@@ -174,6 +174,7 @@ struct _xmpp_conn_t {
|
||||
sock_t sock;
|
||||
int ka_timeout; /* TCP keepalive timeout */
|
||||
int ka_interval; /* TCP keepalive interval */
|
||||
int ka_count; /* TCP keepalive count */
|
||||
|
||||
tls_t *tls;
|
||||
int tls_support;
|
||||
@@ -233,6 +234,7 @@ struct _xmpp_conn_t {
|
||||
xmpp_handlist_t *timed_handlers;
|
||||
hash_t *id_handlers;
|
||||
xmpp_handlist_t *handlers;
|
||||
xmpp_sockopt_callback sockopt_cb;
|
||||
};
|
||||
|
||||
void conn_disconnect(xmpp_conn_t *conn);
|
||||
|
||||
Reference in New Issue
Block a user