FACT++  1.0
void remove_service ( int  req_id)

Definition at line 1558 of file dis.c.

References req_ent::conn_id, dim_print_date_time(), DIS_HEADER, dna_write(), id_get_ptr(), Memory::malloc(), Net_conns, NET_CONNECTION::node, release_conn(), service_id, req_ent::service_id, DIS_PACKET::service_id, DIS_PACKET::size, SRC_DIS, and NET_CONNECTION::task.

Referenced by dis_remove_service().

1559 {
1560  register REQUEST *reqp;
1561  static DIS_PACKET *dis_packet;
1562  static int packet_size = 0;
1563  int service_id;
1564 
1565  reqp = (REQUEST *)id_get_ptr(req_id, SRC_DIS);
1566  if(!reqp)
1567  return;
1568  if( !packet_size ) {
1569  dis_packet = (DIS_PACKET *)malloc((size_t)DIS_HEADER);
1570  packet_size = DIS_HEADER;
1571  }
1572  service_id = (int)((unsigned)reqp->service_id | 0x80000000);
1573  dis_packet->service_id = htovl(service_id);
1574  dis_packet->size = htovl(DIS_HEADER);
1575 /*
1576  if( !dna_write_nowait(reqp->conn_id, dis_packet, DIS_HEADER) )
1577 Has to be dna_write otherwise the client gets the message much before the DNS
1578 */
1579  if( !dna_write(reqp->conn_id, dis_packet, DIS_HEADER) )
1580  {
1582  printf(" Server Removing Service: Couldn't write to Conn %3d : Client %s@%s\n",
1583  reqp->conn_id, Net_conns[reqp->conn_id].task, Net_conns[reqp->conn_id].node);
1584  fflush(stdout);
1585  release_conn(reqp->conn_id, 0, 0);
1586  }
1587 }
int dna_write(int conn_id, void *buffer, int size)
Definition: dna.c:455
unsigned service_id
Definition: db_dim_client.c:22
char task[MAX_TASK_NAME]
Definition: dim.h:408
DllExp DIM_NOSHARE NET_CONNECTION * Net_conns
Definition: conn_handler.c:32
void * id_get_ptr(int id, SRC_TYPES type)
Definition: conn_handler.c:184
int service_id
Definition: dis.c:56
void * malloc()
Definition: EventBuilder.cc:99
static int release_conn(int conn_id, int print_flg, int dns_flag)
Definition: dis.c:2684
char node[MAX_NODE_NAME]
Definition: dim.h:407
int size
Definition: dim.h:244
int service_id
Definition: dim.h:245
void dim_print_date_time()
Definition: utilities.c:134
#define DIS_HEADER
Definition: dim.h:249
int conn_id
Definition: dis.c:55
Definition: dis.c:52

+ Here is the call graph for this function:

+ Here is the caller graph for this function: