Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 May : Re: Detect when command complete

www.cryer.info
Managed Newsgroup Archive

Re: Detect when command complete

Subject:Re: Detect when command complete
Posted by:"Remy Lebeau (TeamB)" (no.spam@no.spam.com)
Date:Thu, 4 May 2006 11:14:04

"Jon" <JonJacobs@comcast.net> wrote in message
news:4459f2c0$1@newsgroups.borland.com...

> Anyway, the fact of getting "good" return codes long before the
> commands were complete remains a mystery.

What you describe is simply not possible, given the code you showed earlier.
Since you are not sending the success responses explicitially in code, they
are automatically sent to the client *after* the OnCommand event handler
exits, so the processing of each command is guaranteed to be completely
finished before the response is sent to the client.

> I am using writestream in the client and readstream in the server. I
> am using OnExecute instead of command handlers in the server.

There is nothing wrong with using CommandHandlers.  I gave you a code
snippet to show how to read/write streams with CommandHandlers.

> I have a new  problem that doesn't even allow the new method
> to come into play.

> MyClient.Connect;
>
> results in:
> Socket error #10061
> connection refused
>
> Why is this?

There are two possible causes of error 10061:

1) your server is not listening on the IP/Port that the client is trying to
connect to.

2) your server is listening on the correct IP/Port, but has too many pending
connections that haven't been accepted yet.  By default, TIdTCPServer has a
pending queue size of 15.  You can use the ListenQueue property to change
that.


Gambit

Replies:

In response to:

www.cryer.info
Managed Newsgroup Archive