sock: Introduce xmpp_sock_t abstraction
libstrophe uses non-blocking sockets and the connect() syscall may return before a TCP connection is established. This doesn't allow to catch all possible errors synchronously and some of the errors are handled in the event handler. In a scenario with multiple SRV records and/or multiple IP addresses resolution, we need to repeat connection attempt on a failure. xmpp_sock_t resolves the above problem. It keeps resolved records and addresses to repeat connect attempt asynchronously.
This commit is contained in:
@@ -36,6 +36,12 @@ typedef struct resolver_srv_rr_struc {
|
||||
void resolver_initialize(void);
|
||||
void resolver_shutdown(void);
|
||||
|
||||
resolver_srv_rr_t *resolver_srv_rr_new(xmpp_ctx_t *ctx,
|
||||
const char *host,
|
||||
unsigned short port,
|
||||
unsigned short prio,
|
||||
unsigned short weight);
|
||||
|
||||
/** Perform lookup for RFC1035 message format.
|
||||
* This function allocates all elements.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user