hi

since 3 weeks I'm trying to send a file with TWSocket  and 
TWSocketServer components..
my idea was to send records like:

  pFileBuf = ^TFileBuf;
  TFileBuf = packed record
    ID : Integer;
    bufSize : Integer;
    buf: array[0..1023] of Byte;
  end;

so I tried to receive these records in a pointer buffer and then to 
process the buffer  like the ICS FAQ for TWSocket "Receiving high speed 
data 
<http://users.pandora.be/sonal.nv/ics/faq/TWSocket.html#Receivinghighspeeddata228>"
 
and write every single record to disk in ProcessData procedure

sometimes the first record was send correctly but the other records were 
currupt.. 

my WSocket1DataSent looks like this:
..
var
 fbuf : TFileBuf;
begin
if sendnow then begin
  if not Eof(f) then begin
       BlockRead(f,FBuf.buf,SizeOf(FBuf.buf),numread);
       FBuf.bufSize:=numread;
       FBuf.ID:=2;
      WSocket1.Send(@fbuf, SizeOf(tfilebuf));
  end;
end; //sendnow
end;//proc

hope someone can help me :)
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to