dealing with the network in Gs,gc,share all work with the network, but still GC most GC dealing process Send_stat Basechannel::sendcmdtry () {if(!m_quecmd.size ())returnSend_stat::send_succeed; for(;;) { if(M_quecmd.empty ()) Break; DATAPKT PKT=M_quecmd.front (); {Send_stat hr= M_pdatalayer->senddata (M_nchannelid, Pkt.pdata, pkt.nsize);//The GC doesn't have anything to do with the network . if(HR! =send_stat::send_succeed) { //put the wait queue, let GS to sendM_pshare->pushgcwait (m_nchannelid); returnhr; }} m_quecmd.pop (); M_pshare-pushpkt (Pkt.pdata, pkt.nsize); } returnSend_stat::send_succeed;} Share:voidShare::onturntoclient (intNchannelid,void* PData,intNlen) {M_pdatalayer->senddata (Nchannelid, PData, Nlen);//share, this layer doesn't even know what it means.}gs:gs this side with the network actually not much, is fixed several places M_spdatalayer->close (Nchannelid);//Kicking players offlineGetbuffernum ()//get the number of buffer packages
GS dealing with the network