Re: [twsocket] Sending Record Type Data over tcp

2009-06-30 Thread Francois Piette
My record type is like; TData = record age: integer; end; PData = ^TData; I send data as follows succesfully; Send(Data, SizeOf(TData)); and receive; Receive(Data, SizeOf(TData)); What i want to do is to send a couple of record types (seperately); and distinguish them on the client

Re: [twsocket] Sending Record Type Data over tcp

2009-06-30 Thread Alper Albayrak
Yes, Im using TCP. I solved my problem (at least in here) with replacing Move() into CopyMemory() I'm using LineMode, to receive all data sent. (My data size is 49b in total and no string data in it) Are there any conflicts i may encounter in the approach stated below? (I intend to replace Rcvd

Re: [twsocket] Sending Record Type Data over tcp

2009-06-30 Thread Fastream Technologies
Is your data size fixed? If so, it might work. The method I suggested was for variable data size. Regards, SZ On Tue, Jun 30, 2009 at 7:29 PM, Alper Albayrak alper...@gmail.com wrote: Yes, Im using TCP. I solved my problem (at least in here) with replacing Move() into CopyMemory() I'm

Re: [twsocket] Sending Record Type Data over tcp

2009-06-30 Thread Arno Garrels
Alper Albayrak wrote: Yes, Im using TCP. I solved my problem (at least in here) with replacing Move() into CopyMemory() I'm using LineMode, to receive all data sent. (My data size is 49b in total and no string data in it) That is dangerous! Are you able to exclude that the LineEnd bytes

Re: [twsocket] Sending Record Type Data over tcp

2009-06-30 Thread RTT
Some remarks: As Francois said, you need to check you received all the data. Your code don't check if RcvdSize is equal to your record data size. Why you need to copy the memory? If you are going to use it locally, at that procedure, just point your different records Data pointers to the Rcvd

Re: [twsocket] Sending Record Type Data over tcp

2009-06-30 Thread Wilfried Mestdagh
Hello Alper, I'm using LineMode, to receive all data sent. (My data size is 49b in total and no string data in it) Are there any conflicts i may encounter in the approach stated below? Yes, if your binary data contains the line end characters you use the your code will fail as Arno already

Re: [twsocket] Sending Record Type Data over tcp

2009-06-29 Thread Fastream Technologies
Hello/Merhaba, Why don't you use the algorithm logic in HTTP and explicitly state how many bytes will follow in a header? for example this is how it is done in chunked encoding in HTTP (pseudo code): 10CRLF 10 bytes of data 20CRLF 20 bytes of data 0CRLF end of stream Regards, SZ On Mon, Jun 29,

Re: [twsocket] Sending Record Type Data over tcp

2009-06-29 Thread RTT
Hello/Merhaba, Why don't you use the algorithm logic in HTTP and explicitly state how many bytes will follow in a header? for example this is how it is done in chunked encoding in HTTP (pseudo code): 10CRLF 10 bytes of data 20CRLF 20 bytes of data 0CRLF end of stream Regards, And an