Re: [twsocket] Sending a mix of text and records through TWSocket

2005-10-27 Thread Wilfried Mestdagh
Hello Geppy, > FillChar(Data, SizeOf(TData), 0); Sorry for that. I have habitude to get rid of compiler warnings, even in a short demo where in this case it was not needed :( I'm glad it works for you now :) 1 additional note. You can also receive direct in your record. This save an additional

Re: [twsocket] Sending a mix of text and records through TWSocket

2005-10-27 Thread Geppy Piloni
>In your server1 example, I modified the ReceiveBinComplete method of >TClient as follows: > >procedure TClient.ReceiveBinComplete; >var >data : TData; >begin > Log(ltSystem, IntToStr(RcvdCount) + ' bytes received'); > WritePtr := 0; // get ready for next receive >

Re: [twsocket] Sending a mix of text and records through TWSocket

2005-10-27 Thread Arno Garrels
Geppy Piloni wrote: > data Move(Rcvd^, Data, SizeOf(Data)); // Rcvd is the pointer to the Should be Move(Rcvd^, Data, SizeOf(TData)); Length of the record Data instead of length of the variable. Arno Garrels -- To unsubscribe or change your settings for TWSocket mailing list please goto

Re: [twsocket] Sending a mix of text and records through TWSocket

2005-10-27 Thread Geppy Piloni
At 13.16 27/10/2005 +0200, you wrote: >Hello Geppy, > >Here is a working client example for this server: [SNIP] >--- >Rgds, Wilfried [TeamICS] >http://www.overbyte.be/eng/overbyte/teamics.html >http://www.mestdagh.biz Hi Wilfried, first of all, thank you for your time and help :) Things are g

Re: [twsocket] Sending a mix of text and records through TWSocket

2005-10-27 Thread Wilfried Mestdagh
Hello Geppy, Here is a working client example for this server: type TState = (stUser, stData); PData = ^TData; TData = record Name: string[10]; ID: integer; end; TForm1 = class(TForm) Cli: TWSocket; procedure FormCreate(Sender: TObject); procedure CliDataAvailable(

Re: [twsocket] Sending a mix of text and records through TWSocket

2005-10-27 Thread Geppy Piloni
At 09.33 27/10/2005 +0200, you wrote: >Hello Geppy, > > > I send the command and the record without waiting any reply from server. > >Yes, but I'm thinking over and it should work. TCP respect data sequence >so cannot be any problem. As soon as server get's the command (and data >len with it I supp

Re: [twsocket] Sending a mix of text and records through TWSocket

2005-10-27 Thread Wilfried Mestdagh
Hello Geppy, > I send the command and the record without waiting any reply from server. Yes, but I'm thinking over and it should work. TCP respect data sequence so cannot be any problem. As soon as server get's the command (and data len with it I suppose), he switch linemode off, and set IsRcvdBi

Re: [twsocket] Sending a mix of text and records through TWSocket

2005-10-26 Thread Geppy Piloni
Thank you guys for your quick replies. I reply here to your different messages. Kirk Dunlap wrote: > Geppy, > It would be helpful to see how you are receiving it. Show us some code on > the receive side of this. as server I used the one contained in Wilfried's example server1.zip at http://t

Re: [twsocket] Sending a mix of text and records through TWSocket

2005-10-26 Thread Angus Robertson - Magenta Systems Ltd
> 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. > > On the server, I receive correctly the text command but not the > record. What I'm doing wrong? You would need to be listening with

Re: [twsocket] Sending a mix of text and records through TWSocket

2005-10-26 Thread Wilfried Mestdagh
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;

Re: [twsocket] Sending a mix of text and records through TWSocket

2005-10-26 Thread Arno Garrels
Geppy Piloni wrote: > On the server, I receive correctly the text command but not the record. > What I'm doing wrong? Is LineMode enabled on the server-side? What does your DataAvailable handler on the server? Arno Garrels -- To unsubscribe or change your settings for TWSocket mailing list ple

Re: [twsocket] Sending a mix of text and records through TWSocket

2005-10-26 Thread Kirk Dunlap
Geppy, It would be helpful to see how you are receiving it. Show us some code on the receive side of this. Kirk On 10/26/05, Geppy Piloni <[EMAIL PROTECTED]> wrote: > > > > Hi all, > I'm trying to implement the client server architecture described here: > http://tinyurl.com/benop > My first app