请教!!用udp传输图片问题???

                            
我在客户端抓取图片用udp协议传输图片,我在客户端   
  var  
          pathname   :   string;  
          picstream   :   TMemorystream;  
          jpg   :   TJPEGImage;  
  begin  
          jpg   :=   TJPEGImage.Create;  
          pathname   :=   '9.bmp';  
          image1.Picture.Bitmap.LoadFromFile(pathname);  
          jpg.Assign(image1.Picture.Bitmap);  
          picstream   :=   TMemorystream.Create;  
          jpg.SaveToStream(picstream);  
          picstream.SaveToFile('1.bmp');  
          showmessage(inttostr(picstream.size));     //显示picstream.size   :=   52043   我把     IdUDPServer1.buffersize   设为60000  
          IdUDPServer1.SendBuffer('127.0.0.1',9001,picstream,sizeof(picstream));  
  end;  
  服务器端:  
  var  
          picstream   :   TMemorystream;  
  begin  
          //sleep(10000);  
          picstream   :=   TMemorystream.Create;  
          picstream.CopyFrom(adata,sizeof(adata));  
          picstream.SaveToFile('3.bmp');  
  end;  
  结果是3.bmp只在4k,图片也没读出来。  
  请教这是为什么呀????  
   
 

查看回复