FACT++  1.0
void retry_dns_connection ( DNS_CONN connp)

Definition at line 377 of file open_dns.c.

References dns_ent::conn_id, dns_ent::connecting, dna_open_client(), dtq_rem_entry(), dns_ent::error_rout, get_dns_pars(), i, MAX_DNS_NODE, MAX_NODE_NAME, dns_ent::pending, dns_ent::recv_rout, dns_ent::src_type, dns_ent::task_name, TCPIP, Timer_q, and dns_ent::timr_ent.

378 {
379  char nodes[MAX_DNS_NODE];
380  char node_info[MAX_NODE_NAME+4];
381  register char *dns_node, *ptr;
382  register int conn_id, node_exists;
383  static int retrying = 0;
384  int i, dns_port;
385 
386  if( retrying ) return;
387  retrying = 1;
388 
389  conn_id = 0;
390  node_exists = get_dns_pars(connp, nodes, &dns_port);
391  if(node_exists)
392  {
393  ptr = nodes;
394  while(1)
395  {
396  dns_node = ptr;
397  if( (ptr = (char *)strchr(ptr,',')) )
398  {
399  *ptr = '\0';
400  ptr++;
401  }
402  strcpy(node_info,dns_node);
403  for(i = 0; i < 4; i ++)
404  node_info[(int)strlen(node_info)+i+1] = (char)0xff;
405  connp->conn_id = 0;
406  connp->connecting = 1;
407  conn_id = dna_open_client( node_info, connp->task_name,
408  dns_port, TCPIP,
409  connp->recv_rout, connp->error_rout, connp->src_type );
410  connp->connecting = 0;
411  if( conn_id )
412  break;
413  if( !ptr )
414  break;
415  }
416  }
417  connp->conn_id = conn_id;
418  if(conn_id)
419  {
420  connp->pending = 0;
421  dtq_rem_entry( Timer_q, connp->timr_ent );
422  }
423  retrying = 0;
424 }
int dna_open_client(char *server_node, char *server_task, int port, int server_protocol, void(*read_ast)(), void(*error_ast)(), SRC_TYPES src_type)
Definition: dna.c:733
int i
Definition: db_dim_client.c:21
#define TCPIP
Definition: dim.h:194
char task_name[MAX_TASK_NAME]
Definition: open_dns.c:28
int get_dns_pars(DNS_CONN *connp, char *node, int *port)
Definition: open_dns.c:206
TIMR_ENT * timr_ent
Definition: open_dns.c:32
static int Timer_q
Definition: open_dns.c:39
#define MAX_DNS_NODE
Definition: open_dns.c:13
int connecting
Definition: open_dns.c:36
void(* error_rout)()
Definition: open_dns.c:31
SRC_TYPES src_type
Definition: open_dns.c:33
int conn_id
Definition: open_dns.c:34
int dtq_rem_entry(int queue_id, TIMR_ENT *entry)
Definition: dtq.c:503
#define MAX_NODE_NAME
Definition: dim.h:180
int pending
Definition: open_dns.c:35
void(* recv_rout)()
Definition: open_dns.c:30

+ Here is the call graph for this function: