Hello Geppy, As Kirk and Arno mentioned show us how you receive the data. maybe one remark at the moment:
> wsocket.LineMode := True; > WSocket.SendStr(EditCommand.Text + #13#10); // the command is 'DATA ' > // r fields filled with some data > pr := @r; > wsocket.LineMode := False; > wsocket.Send(pr, SizeOf(r)); Not needed to switch LineMode at the sender. TWSocket will only use lineMode whilst receivin. Also better to work event driven between the 2 applications: - send data whitch tell receiver you want to send a certain binary - receiver set linemode to false and answer 'ok i'm ready' - sender send the binary when he received the 'ok ready' - receiver say 'ok received' and switch lineMode back on - sender can go on now with next command if any on sender lineMode may be switched on all the time as he does only receive line based commands. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Wednesday, October 26, 2005, 19:09, Geppy Piloni wrote: > Hi all, > I'm trying to implement the client server architecture described here: > http://tinyurl.com/benop > My first approach was with Indy 10, but after some attempts, I found quite > difficult to manage the complexity of multithread programming, so I dropped > Indy and now I'm trying ICS. > I had a positive experience with ICS HTTP and mail components some years > ago and I feel more comfortable with event handling than multithreading... > I found a very useful example here http://tinyurl.com/cqkmh , Server1.zip : > thank you Wilfried :) > I studied also the ICS FAQ about receiving high speed data > http://tinyurl.com/762c6 > Starting from various TCP client inlcuded in ICS examples, I tried to send > through TWSocket a mix of text commands and records but I wasn't successful. > Assuming a given record and his pointer... > PTMyRec = ^TMyRec; > TMyRec = packed record > .. > .. > end; > ... and following the protocol implemented in the above mentioned example > (server1.zip) I'm trying to send a text command followed by a record. > I tried this way from a generic client: > var > pr : PTMyRec; > r : TMyRec; > begin > wsocket.LineMode := True; > WSocket.SendStr(EditCommand.Text + #13#10); // the command is 'DATA ' > // r fields filled with some data > pr := @r; > wsocket.LineMode := False; > wsocket.Send(pr, SizeOf(r)); > end; > On the server, I receive correctly the text command but not the record. > What I'm doing wrong? > Thank you in advance for your replies. > -- > Geppy Piloni -- 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