Hello!
Have a look at TTWSChatForm.CliWSocketDataAvailable in TWSChat1.pas
source
file. There is a RcvBuf which is a stically allocated array of char (you
can
make it dynamically allocated) where data is received and the end of what
has already been received. RcvLen variable keep track of
Hi, this is David.
I asked about a method to recognize the splitted packets and to join
them upon arrival of the last one. So far my protocol works fine, and
all the data is assembled in an orderly manner. For large texts or
binary data, the clients knows how to handle it as follows:
The
- Original Message -
From: Kei [EMAIL PROTECTED]
To: ICS support mailing twsocket@elists.org
Sent: Tuesday, November 01, 2005 9:45 AM
Subject: [twsocket] transmission stress test
Hi, this is David.
I asked about a method to recognize the splitted packets and to join
them upon arrival
Hello David,
I suggest to first see if the sender or the receiver fails. you can easy
do that if you hang SocketSpy (user made) between them.
Line 4117: Received -1 bytes, Remaining 3123 bytes
Line 4118: WARNING! Transfer went wrong! Error 0
No nothing went nececary wrong. Ignore 0 and -1,
Message -
From: Kei [EMAIL PROTECTED]
To: ICS support mailing twsocket@elists.org
Sent: Tuesday, November 01, 2005 10:32 AM
Subject: Re: [twsocket] transmission stress test
I'm Sorry! I thought the code was too big to attach.. anyway here it is
My component TSession is a descendent from
.
--
Contribute to the SSL Effort. Visit
http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
http://www.overbyte.be
- Original Message -
From: Kei [EMAIL PROTECTED]
To: ICS support mailing twsocket@elists.org
Sent: Tuesday, November 01, 2005 9:45 AM
Subject: [twsocket] transmission stress
Hello David,
So I ignored the zero und -1 returned by the Receive(), and it worked :)
Great ! I'm glad it works for you :)
But the TempSize in my code was never changed. it was set as to a
constant value en the constructor.
Ok no problem then. But if your buffer has a constant size, then
I got it. so this is what I'll do:
A txt 10240
B (malloc ptrAltogether 10240 bytes; Let sizeRemain = 10240;sizeDone=0)
sendtxt
A 010010101010101...
B (First packet is ready:
var ptrTemp: array[0..MAX_PACK] of char;
Zero(ptrTemp);
if(sizeThisPack = Receive(ptrTemp) 0)
{