Newsgroups : Borland : borland.public.delphi.internet.winsock : 2008 Jan : Re: TClientSocket write progress???

www.cryer.info
Managed Newsgroup Archive

Re: TClientSocket write progress???

Subject:Re: TClientSocket write progress???
Posted by:"Bo Berglund" (bo.berglu..@telia.com)
Date:Wed, 23 Jan 2008 21:53:34

On Wed, 23 Jan 2008 12:19:20 -0800, "Remy Lebeau \(TeamB\)"
<no.spam@no.spam.com> wrote:

>
>"Bo Berglund" <bo.berglund@telia.com> wrote in message
>news:s12fp3trrrr9cepacr0mpr7iuvicskjfpa@4ax.com...
>
>> Remember I use the socket non-blocking.
>
>Not relevant.  At some point, you have to send a block of your data to the
>socket.  So just update your progress info at that same point in the code.

But when I send using SendText the complete string I am about to send
is "swallowed" in an instant and the sendtext call immediately
returns. I only call this once for each block of data I send...
So there is no progress of blocks being sent to show.

I can see in the debugger that the call has finished and at the same
time I can monitor my network icon and I see a lot of activity for
maybe 10-15 seconds (the string is about 7 Mb in size).

>> I use Socket.SendText
>
>SendText() returns the number of bytes actually passed to the socket.  If
>the return value is less than the length of the string, you have to call
>SendText() again to resend the remaining characters.
This does not happen, the sendtext method always returns the length of
the string I am supplying to it...

>If SendText()
>returns -1 for a non-blocking socket, then the socket's internal buffer is
>full and you have to wait until the OnWrite event is triggered before you
>can pass more data to the socket.  So you will just have to store the rest
>of your data to a separate buffer, and then flush the buffer to the socket
>at a later time.  Go to http://www.deja.com and search the newsgroup
>archives.  I have posted examples of using the OnWrite event several times
>before.
>


/BoB

Replies:

In response to:

www.cryer.info
Managed Newsgroup Archive