Esempio n. 1
0
static int __no_socket(struct homer_sender *hs) {
	int ret;

	if (hs->retry > time(NULL))
		return 0;

	ilog(LOG_INFO, "Connecting to Homer at %s", endpoint_print_buf(&hs->endpoint));

	ret = connect_socket_nb(&hs->socket, hs->protocol, &hs->endpoint);
	return __check_conn(hs, ret);
}
Esempio n. 2
0
int connect_to_graphite_server(const endpoint_t *ep) {
	graphite_ep = ep;
	int rc;

	ilog(LOG_INFO, "Connecting to graphite server %s", endpoint_print_buf(ep));

	rc = connect_socket_nb(&graphite_sock, SOCK_STREAM, ep);
	if (rc == -1) {
		ilog(LOG_ERROR,"Couldn't make socket for connecting to graphite.");
		return -1;
	}
	if (rc == 0)
		ilog(LOG_INFO, "Graphite server connected.");
	else {
		/* EINPROGRESS */
		ilog(LOG_INFO, "Connection to graphite is in progress.");
		connectinprogress = 1;
	}

	return 0;
}