connection_client_connected(conn, errno == 0);
}
-int connection_client_connect(struct connection *conn)
+int connection_client_connect_with_retries(struct connection *conn,
+ unsigned int msecs)
{
const struct connection_settings *set = &conn->list->set;
int fd;
fd = net_connect_ip(&conn->remote_ip, conn->remote_port,
(conn->local_ip.family != 0 ?
&conn->local_ip : NULL));
- } else if (conn->list->set.unix_client_connect_msecs == 0) {
+ } else if (msecs == 0) {
fd = net_connect_unix(conn->base_name);
} else {
- fd = net_connect_unix_with_retries(
- conn->base_name,
- conn->list->set.unix_client_connect_msecs);
+ fd = net_connect_unix_with_retries(conn->base_name, msecs);
}
if (fd == -1)
return -1;
return 0;
}
+int connection_client_connect(struct connection *conn)
+{
+ return connection_client_connect_with_retries(conn,
+ conn->list->set.unix_client_connect_msecs);
+}
+
static void connection_update_counters(struct connection *conn)
{
if (conn->input != NULL)
struct ostream *output) ATTR_NULL(3);
int connection_client_connect(struct connection *conn);
+/* Connect to UNIX socket. If it fails, try it up to msecs is reached.
+ Overrides connection_settings.unix_client_connect_msecs. */
+int connection_client_connect_with_retries(struct connection *conn,
+ unsigned int msecs);
/* Disconnects a connection */
void connection_disconnect(struct connection *conn);