FACT++  1.0
int send_service ( int  conn_id,
DIC_SERVICE servp 
)

Definition at line 1891 of file dic.c.

References DIC_HEADER, dim_print_date_time(), dna_write_nowait(), DIC_PACKET::format, Memory::malloc(), MAX_NAME, Net_conns, dic_serv::serv_id, dic_serv::serv_name, DIC_PACKET::service_id, DIC_PACKET::service_name, DIC_PACKET::size, STAMPED, dic_serv::stamped, DIC_PACKET::timeout, dic_serv::timeout, type, DIC_PACKET::type, and dic_serv::type.

Referenced by request_service(), and send_service_command().

1892 {
1893  static DIC_PACKET *dic_packet;
1894  static int serv_packet_size = 0;
1895  int type, ret;
1896 
1897  if( !serv_packet_size ) {
1898  dic_packet = (DIC_PACKET *)malloc((size_t)DIC_HEADER);
1899  serv_packet_size = DIC_HEADER;
1900  }
1901 
1902  strncpy( dic_packet->service_name, servp->serv_name, (size_t)MAX_NAME );
1903  type = servp->type;
1904  if(servp->stamped)
1905  type |= STAMPED;
1906  dic_packet->type = htovl(type);
1907  dic_packet->timeout = htovl(servp->timeout);
1908  dic_packet->service_id = htovl(servp->serv_id);
1909  dic_packet->format = htovl(MY_FORMAT);
1910  dic_packet->size = htovl(DIC_HEADER);
1911  ret = dna_write_nowait(conn_id, dic_packet, DIC_HEADER);
1912  if(!ret)
1913  {
1915  printf(" Client Sending Service Request: Couldn't write to Conn %3d : Server %s@%s service %s\n",
1916  conn_id, Net_conns[conn_id].task, Net_conns[conn_id].node, servp->serv_name);
1917  fflush(stdout);
1918  }
1919  return(ret);
1920 }
#define MAX_NAME
Definition: dim.h:182
Definition: dns.c:26
int stamped
Definition: dim.h:478
int type
Definition: dim.h:234
char service_name[MAX_NAME]
Definition: dim.h:232
int service_id
Definition: dim.h:233
DllExp DIM_NOSHARE NET_CONNECTION * Net_conns
Definition: conn_handler.c:32
int timeout
Definition: dim.h:235
void * malloc()
Definition: EventBuilder.cc:99
#define STAMPED
Definition: dim_common.h:17
#define DIC_HEADER
Definition: dim.h:240
int type
Definition: dim.h:465
int type
int serv_id
Definition: dim.h:461
int dna_write_nowait(int conn_id, void *buffer, int size)
Definition: dna.c:412
int size
Definition: dim.h:231
int format
Definition: dim.h:236
char serv_name[MAX_NAME]
Definition: dim.h:460
void dim_print_date_time()
Definition: utilities.c:134
int timeout
Definition: dim.h:466

+ Here is the call graph for this function:

+ Here is the caller graph for this function: