Beispiel #1
0
int
start_server(GError **error)
{
	if (!*unix_socket_path && inet_socket_port <= 0) {
		GSETERROR(error, "No server configured");
		return 0;
	}
	if (unix_socket_path[0]) {
		if (!start_unix_server(error)) {
			GSETERROR(error,"Failed to start the UNIX server");
			stop_server();
			return 0;
		}
	}
	
	if (inet_socket_port > 0) {
		if (!start_inet_server(error)) {
			GSETERROR(error,"Failed to start the INET server");
			stop_server();
			return 0;
		}
	}

	return 1;
}
Beispiel #2
0
int
start_server(long sock_timeout, GError **error)
{
	if (!start_unix_server(sock_timeout,error)) {
		GSETERROR(error,"Failed to start the UNIX server");
		stop_server();
		return 0;
	}
	
	if (port_inet<0)
		NOTICE("No INET port provided, no INET server started");
	else {
		if (!start_inet_server(sock_timeout,error)) {
			GSETERROR(error,"Failed to start the INET server");
			stop_server();
			return 0;
		}
	}

	return 1;
}