FACT++  1.0
int dna_write_nowait ( int  conn_id,
void *  buffer,
int  size 
)

Definition at line 412 of file dna.c.

References DNA_HEADER::data_size, Dna_conns, dna_write_bytes(), FALSE, HDR_MAGIC, DNA_HEADER::header_magic, DNA_HEADER::header_size, READ_HEADER_SIZE, tcpip_failure(), TRUE, and DNA_CONNECTION::writing.

Referenced by check_validity(), dic_release_service(), dis_send_service(), dna_open_client(), execute_service(), handle_client_request(), handle_registration(), inform_clients(), kill_servers(), send_command(), and send_service().

413 {
414  register DNA_CONNECTION *dna_connp;
415  DNA_HEADER header_pkt;
416  register DNA_HEADER *header_p = &header_pkt;
417  int tcpip_code, ret = 1;
418 
419  DISABLE_AST
420  dna_connp = &Dna_conns[conn_id];
421  if(!dna_connp->busy)
422  {
423  ENABLE_AST
424  return(2);
425  }
426  dna_connp->writing = TRUE;
427 
428  header_p->header_size = htovl(READ_HEADER_SIZE);
429  header_p->data_size = htovl(size);
430  header_p->header_magic = (int)htovl(HDR_MAGIC);
431  tcpip_code = dna_write_bytes(conn_id, &header_pkt, READ_HEADER_SIZE, 1);
432  if(tcpip_failure(tcpip_code))
433  {
434  dna_connp->writing = FALSE;
435  ENABLE_AST
436  return(0);
437  }
438  tcpip_code = dna_write_bytes(conn_id, buffer, size, 1);
439  if(tcpip_failure(tcpip_code))
440  {
441  ret = 0;
442  }
443  dna_connp->writing = FALSE;
444  ENABLE_AST
445  return(ret);
446 }
#define HDR_MAGIC
Definition: dim.h:209
static int dna_write_bytes(int conn_id, void *buffer, int size, int nowait)
Definition: dna.c:270
#define READ_HEADER_SIZE
Definition: dna.c:21
int header_magic
Definition: dim.h:357
#define TRUE
Definition: dim.h:135
int header_size
Definition: dim.h:355
#define FALSE
Definition: dim.h:136
int writing
Definition: dim.h:391
int buffer[BUFFSIZE]
Definition: db_dim_client.c:14
int size
Definition: db_dim_server.c:17
int data_size
Definition: dim.h:356
DllExp DIM_NOSHARE DNA_CONNECTION * Dna_conns
Definition: conn_handler.c:31
int tcpip_failure(int code)
Definition: tcpip.c:1540

+ Here is the call graph for this function:

+ Here is the caller graph for this function: