Thus making it unsafe to call from an event loop thread. However I do not think it would be safe to call it from a separate thread either, probably all of libstrophe calls would need to be moved in that case?
It calls sock_new which calls resolver_srv_lookup which then calls either res_query or resolver_ares_srv_lookup both of which are blocking and may take many seconds.
sock_new also calls sock_getaddrinfo which calls getaddrinfo which is also a slow blocking call.
xmpp_connect_client also calls _conn_connect which then calls sock_connect which also calls sock_getaddrinfo
sock_connect also calls connect but this is after the socket is set to nonblocking so I think that may not be a blocking call here.
Thus making it unsafe to call from an event loop thread. However I do not think it would be safe to call it from a separate thread either, probably all of libstrophe calls would need to be moved in that case?
It calls
sock_newwhich callsresolver_srv_lookupwhich then calls eitherres_queryorresolver_ares_srv_lookupboth of which are blocking and may take many seconds.sock_newalso callssock_getaddrinfowhich callsgetaddrinfowhich is also a slow blocking call.xmpp_connect_clientalso calls_conn_connectwhich then callssock_connectwhich also callssock_getaddrinfosock_connectalso callsconnectbut this is after the socket is set to nonblocking so I think that may not be a blocking call here.