Esempio n. 1
0
unsigned int Configuration::get_local_port() {
	gint local_port = m_conf_client->get_int("SOFTWARE\\Aeskulap\\preferences\\local_port");
	if(local_port <= 0) {
		local_port = 6000;
		set_local_port(local_port);
	}
	return (unsigned int)local_port;
}
Esempio n. 2
0
unsigned int Configuration::get_local_port() {
	m_conf_client = Gnome::Conf::Client::get_default_client();
	gint local_port = m_conf_client->get_int("/apps/aeskulap/preferences/local_port");

	if(local_port <= 0) {
		local_port = 6000;
		set_local_port(local_port);
	}
	
	return (unsigned int)local_port;
}
Esempio n. 3
0
void init(char* remote, int REMOTE_PORT){
  if ((s=socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP))==-1){
    perror("Error creating socket");
    exit(1);
  }

  set_local_port(0);
  set_remote(remote,REMOTE_PORT);

  if (bind(s, (struct sockaddr*)&addr_local, sizeof(addr_local))==-1){
    perror("Failed to bind");
    exit(1);
  }

  fds[0].fd = s;
  fds[0].events = POLLIN;

  msg m;
  send_message(&m);
}