void configure_box (void)
{
    int result, i;
    
    init_configure ();
    run_dlg (conf_dlg);

    result = conf_dlg->ret_value;
    if (result == B_ENTER || result == B_EXIT){
	for (i = 0; check_options [i].text; i++)
	    if (check_options [i].widget->state & C_CHANGE){
		if (check_options [i].toggle_function)
		    (*check_options [i].toggle_function)();
		else
		    *check_options [i].variable =
			!(*check_options [i].variable);
	    }
	pause_after_run = pause_radio->sel;
    }

    /* If they pressed the save button */
    if (result == B_EXIT){
	save_configure ();
	sync_profiles ();
    }

    destroy_dlg (conf_dlg);
}
示例#2
0
文件: main.cpp 项目: iYefeng/acl
static void run_udp_service(int argc, char* argv[])
{
	udp_service& us = acl::singleton2<udp_service>::get_instance();
	init_configure(us);

	if (argc >= 2 && strcmp(argv[1], "alone") == 0)
	{
		// 日志输出至标准输出
		acl::log::stdout_open(true);

		// 监听的地址列表,格式:ip:port1,ip:port2,...
		const char* addrs = "0.0.0.0:8390";
		printf("bind on: %s\r\n", addrs);

		// 测试时设置该值 > 0 则指定服务器处理客户端连接过程的
		// 会话总数(一个连接从接收到关闭称之为一个会话),当
		// 处理的连接会话数超过此值,测试过程结束;如果该值设
		// 为 0,则测试过程永远不结束
		unsigned int count = 0;

		// 单独运行方式
		if (argc >= 3)
			us.run_alone(addrs, argv[2], count);
		else
			us.run_alone(addrs, NULL, count);

		printf("Enter any key to exit now\r\n");
		getchar();
	}
	else
	{
#ifdef	WIN32
		// 日志输出至标准输出
		acl::log::stdout_open(true);

		// 监听的地址列表,格式:ip:port1,ip:port2,...
		const char* addrs = "0.0.0.0:8390";
		printf("bind on: %s\r\n", addrs);

		// 测试时设置该值 > 0 则指定服务器处理客户端连接过程的
		// 会话总数(一个连接从接收到关闭称之为一个会话),当
		// 处理的连接会话数超过此值,测试过程结束;如果该值设
		// 为 0,则测试过程永远不结束
		unsigned int count = 0;

		// 单独运行方式
		us.run_alone(addrs, NULL, count);
		printf("Enter any key to exit now\r\n");
		getchar();
#else
		// acl_master 控制模式运行
		us.run_daemon(argc, argv);
#endif
	}
}
示例#3
0
文件: main.cpp 项目: iYefeng/acl
static void run_tcp_service(int argc, char* argv[])
{
	tcp_service& ts = acl::singleton2<tcp_service>::get_instance();
	init_configure(ts);

	if (argc >= 2 && strcmp(argv[1], "alone") == 0)
	{
		// 日志输出至标准输出
		acl::log::stdout_open(true);

		// 监听的地址列表,格式:ip:port1,ip:port2,...
		const char* addrs = ":8888";
		printf("listen on: %s\r\n", addrs);

		// 测试时设置该值 > 0 则指定服务器处理客户端连接过程的
		// 会话总数(一个连接从接收到关闭称之为一个会话),当
		// 处理的连接会话数超过此值,测试过程结束;如果该值设
		// 为 0,则测试过程永远不结束
		unsigned int count = 0;

		// 测试过程中指定线程池最大线程个数
		unsigned int max_threads = 100;

		// 单独运行方式

		if (argc >= 3)
			ts.run_alone(addrs, argv[2], count, max_threads);
		else
			ts.run_alone(addrs, NULL, count, max_threads);

		printf("Enter any key to exit now\r\n");
		getchar();
	}
	else
	{
#ifdef	WIN32
		// 日志输出至标准输出
		acl::log::stdout_open(true);

		// 监听的地址列表,格式:ip:port1,ip:port2,...
		const char* addrs = "127.0.0.1:8888";
		printf("listen on: %s\r\n", addrs);

		// 测试时设置该值 > 0 则指定服务器处理客户端连接过程的
		// 会话总数(一个连接从接收到关闭称之为一个会话),当
		// 处理的连接会话数超过此值,测试过程结束;如果该值设
		// 为 0,则测试过程永远不结束
		unsigned int count = 0;

		// 测试过程中指定线程池最大线程个数
		unsigned int max_threads = 100;

		// 单独运行方式
		ts.run_alone(addrs, NULL, count, max_threads);
		printf("Enter any key to exit now\r\n");
		getchar();
#else
		// acl_master 控制模式运行
		ts.run_daemon(argc, argv);
#endif
	}
}