FACT++  1.0
static int find_pend_conn ( char *  node,
char *  task,
int  port,
SRC_TYPES  src_type,
int  type 
)
static

Definition at line 675 of file dna.c.

References i, PENDING_OPEN::last_used, MAX_CONNS, MAX_TMOUT_PENDING_CONNS, PENDING_OPEN::node_name, PENDING_OPEN::port, size, PENDING_OPEN::src_type, PENDING_OPEN::task_name, time, and TMOUT_PENDING_CONN_TMOUT.

Referenced by dna_close(), dna_open_client(), and save_node_task().

676 {
677  register PENDING_OPEN *pending_connp;
678  register int i, size;
679  time_t curr_time;
680 
681  if(type == 0)
682  {
683  pending_connp = &Pending_conns[1];
684  size = MAX_CONNS;
685  }
686  else
687  {
688  pending_connp = &Pending_conns_tmout[1];
690  curr_time = time(NULL);
691  for( i = 1; i < size; i++, pending_connp++ )
692  {
693  if( pending_connp->task_name[0] != '\0' )
694  {
695  if( curr_time - pending_connp->last_used > TMOUT_PENDING_CONN_TMOUT )
696  {
697  pending_connp->task_name[0] = '\0';
698  }
699  }
700  }
701  pending_connp = &Pending_conns_tmout[1];
702  }
703  for( i = 1; i < size; i++, pending_connp++ )
704  {
705  if( (!strcmp(pending_connp->node_name, node)) &&
706  (!strcmp(pending_connp->task_name, task)) &&
707  (pending_connp->port == port) &&
708  (pending_connp->src_type == src_type))
709  {
710  return(i);
711  }
712  }
713  return(0);
714 }
Definition: dns.c:26
#define TMOUT_PENDING_CONN_TMOUT
Definition: dna.c:36
char node_name[MAX_NODE_NAME]
Definition: dna.c:29
time_t last_used
Definition: dna.c:33
int i
Definition: db_dim_client.c:21
SRC_TYPES src_type
Definition: dna.c:32
#define MAX_CONNS
Definition: dim.h:163
static PENDING_OPEN Pending_conns[MAX_CONNS]
Definition: dna.c:38
int type
int port
Definition: dna.c:31
Warning because the service this data corrsponds to might have been last updated longer ago than Local time
Definition: smartfact.txt:92
#define MAX_TMOUT_PENDING_CONNS
Definition: dna.c:37
int size
Definition: db_dim_server.c:17
static PENDING_OPEN Pending_conns_tmout[MAX_TMOUT_PENDING_CONNS]
Definition: dna.c:39
char task_name[MAX_TASK_NAME]
Definition: dna.c:30

+ Here is the caller graph for this function: