Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 May : Re: TServerSocket.OnClientRead no fired

www.cryer.info
Managed Newsgroup Archive

Re: TServerSocket.OnClientRead no fired

Subject:Re: TServerSocket.OnClientRead no fired
Posted by:"Remy Lebeau (TeamB)" (no.spam@no.spam.com)
Date:Mon, 15 May 2006 10:49:41

"George Wei" <nobody@yahoo.com> wrote in message
news:Xns97C46F40F214Fnobodyyahoocom@207.105.83.66...

> When I click button btnSend, ServerSocket1ClientConnect is fired
> but ServerSocket1ClientRead is not. What's the problem?

You are sending your data to the server too soon.  When used in non-blocking
mode, TClientSocket::Open() is does not block until the socket is connected.
It returns immediately after beginning the asynchronous process of
connecting to the server.  So you are sending the data before the socket has
actually connected.  You need to wait for the OnConnect event to trigger
before then sending your data.


Gambit

Replies:

In response to:

www.cryer.info
Managed Newsgroup Archive