void on_process_packet(struct connection *c,rpacket_t r) { //send2_all_client(r); wpacket_t w = wpacket_create_by_rpacket(wpacket_allocator,r); connection_send(c,w,NULL); ++send_request; total_bytes_recv += rpacket_len(r); rpacket_destroy(&r); ++packet_recv; }
void on_process_packet(struct connection *c,rpacket_t r) { //uint32_t i = 0; //send2_all_client(r); uint32_t pk_size = rpacket_len(r); wpacket_t w = wpacket_create_by_rpacket(r); printf("pk_size:%d\n",pk_size); connection_send(c,w,0); rpacket_destroy(&r); //++packet_recv; }
void send2_all_client(rpacket_t r) { uint32_t i = 0; wpacket_t w; for(; i < MAX_CLIENT; ++i) { if(clients[i]) { w = wpacket_create_by_rpacket(r); ++send_request; //connection_send(clients[i],w,0); connection_push_packet(clients[i],w); } } }