Hello Selahattin, > sometimes the first record was send correctly but the other records were > currupt..
Please try to specify exacly whats wrong: Can you tell when first record is send/received correct and when not ? Also if first record is not correct then what exacly is not correct ? Also what exacly is corrupt ? You can download SocketSpy from user made and 'hang'it between sender and receiver. Then you know already wich of the programs failing. Then we can go on searching. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Saturday, December 10, 2005, 01:04, Selahattin Erkoc wrote: > 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