FACT++  1.0
static void handler ( int  conn_id,
char *  packet,
int  size,
int  status 
)
static

Definition at line 635 of file webServer.c.

References dim_print_date_time(), Net_conns, sendFile(), STA_CONN, STA_DATA, STA_DISC, web_close(), and WebDID_Debug.

Referenced by DimServer::addClientExitHandler(), DimServer::addErrorHandler(), DimClient::addErrorHandler(), DimServer::addExitHandler(), FactGui::CallInfoHandler(), DimService::declareIt(), DimCommand::declareIt(), DimInfo::getString(), main(), ConnectionUSB::Out(), ServiceList::SetHandler(), DimInfo::subscribe(), DimStampedInfo::subscribe(), and DimUpdatedInfo::subscribe().

636 {
637  switch(status)
638  {
639  case STA_DISC: /* connection broken */
640 if(WebDID_Debug)
641 {
643  printf(" Disconnect received - conn: %d to %s@%s\n", conn_id,
644  Net_conns[conn_id].task,Net_conns[conn_id].node );
645 }
646  web_close(conn_id);
647  break;
648  case STA_CONN: /* connection received */
649 if(WebDID_Debug)
650 {
652  printf(" Connection request received - conn: %d\n", conn_id);
653 }
654  break;
655  case STA_DATA: /* normal packet */
656 /*
657  dim_print_date_time();
658  printf(" conn %d packet received:\n", conn_id);
659  printf("packet size = %d\n", size);
660  printf("%s\n",packet);
661  fflush(stdout);
662 */
663  sendFile(conn_id, packet, size);
664  break;
665  default:
667  printf( " - DIM panic: recv_rout(): Bad switch, exiting...\n");
668  abort();
669  }
670 }
#define STA_DATA
Definition: dim.h:198
Definition: dns.c:26
#define STA_DISC
Definition: dim.h:197
DllExp DIM_NOSHARE NET_CONNECTION * Net_conns
Definition: conn_handler.c:32
int web_close()
int size
Definition: db_dim_server.c:17
void dim_print_date_time()
Definition: utilities.c:134
int WebDID_Debug
Definition: webServer.c:7
#define STA_CONN
Definition: dim.h:199
void sendFile(int conn_id, char *buffer, int size)
Definition: webServer.c:447

+ Here is the call graph for this function:

+ Here is the caller graph for this function: