int ReceivePacket(BYTE *pBuff)//无法接收数据:-7,分组大小
{
 int i;
 int m;
 int n;
 int p;
 int PacketSize;
// char *ptcp;
// char *ptswap;
 BYTE *ptcp;
 BYTE *ptswap;
 for(i=0;i<m_nRouteSum;i++)
 {
  //ms_ReceiveBufferPacketSize[i]+=ms_nBufferPacketNum[i];
  if((*ms_ReceiveBufferPacketSize[i]!=0))
  {   
   //ptcp=ms_ReceiveBuffer[i]+1500*(ms_nBufferPacketNum[i]-1);
   ptcp=ms_ReceiveBuffer[i];
   strcpy((char *)pBuff,(char *)ptcp);
   PacketSize=*ms_ReceiveBufferPacketSize[i];
   if(PacketSize==0)
    continue;
   for(p=1;p<=*(ms_nBufferPacketNum[i]-1);p++)
   {
    //ptswap=ms_ReceiveBuffer[i]+1500*(ms_nBufferPacketNum[i]-p);
    //strcpy(ptswap,ptswap-1500);
    ptswap=ms_ReceiveBuffer[i]+1500*p;//将ms_ReceiveBuffer中的数据依次向前移动一个单元    
    strcpy((char *)(ptswap-1500),(char *)ptswap); 


    //*ms_ReceiveBufferPacketSize[i]=*(ms_ReceiveBufferPacketSize[i]-1);
    //--ms_ReceiveBufferPacketSize[i];
    *ms_ReceiveBufferPacketSize[i]=*(ms_ReceiveBufferPacketSize[i]+1);//将ReceiveBufferPacketSize中的数据依次向前移动一个单元
    ++ms_ReceiveBufferPacketSize[i];
   }
  }
  return PacketSize;
 }
 return -7;
}

posted @ 2010-11-10 11:43  hongcha_717  阅读(2321)  评论(0编辑  收藏  举报