/**Main server routine*/ void srv_do(srv_t *srv) { while(srv_is_working(srv)) { srv_recv_req(srv); if(srv_has_req(srv)) { srv_handle_req(srv); //sets srv->fn_rv, which influences further processing srv_prepare_resp(srv); srv_send_resp(srv); } } }
void srv_do(srv_t *srv) { char addr_str[16]; int rv; while(srv_is_working(srv)) { srv_recv_req(srv); if(srv_has_req(srv)) { srv_handle_req(srv); //sets srv->fn_rv, which influences further processing srv_prepare_resp(srv); srv_send_resp(srv); } else { /* printf("RECV: NOTHING\n"); */ } } }