Exemple #1
0
int 
pxy_init_master()
{
	master = (pxy_master_t*)malloc(sizeof(*master));
	if (!master) {
		E("no memory for master");
		return -1;
	}


	return pxy_start_listen();
}
Exemple #2
0
int 
pxy_init_master()
{
    if(!pxy_init_config()){
	D("config initialize error");
	return -1;
    }
 
    master = (pxy_master_t*)malloc(sizeof(*master));
    if(!master){
	D("no memory for master");
	return -1;
    }
    master->config = config;
    master->workers = 
	(pxy_worker_t**)malloc(config->worker_count * sizeof(pxy_worker_t));

    if(!master->workers) {
	D("no memory for workers");
	return -1;
    }

    return pxy_start_listen();
}