Newsgroups : Borland : borland.public.delphi.internet.winsock : 2005 May : TcpClient1.Receiveln method and TcpClient1Receive event

www.cryer.info
Managed Newsgroup Archive

TcpClient1.Receiveln method and TcpClient1Receive event

Subject:TcpClient1.Receiveln method and TcpClient1Receive event
Posted by:"Gianluca" (gianlucadei..@tiscali.it)
Date:Mon, 16 May 2005 16:44:57

Hello all,

we are developing a client application that implement a TcpClient object.
We are a bit confused between "blocked" and "NOT-blocked" socket, the use of
Receiveln method and Receive event.

We are oriented for a "Not blocked" socket(if this means that we get control
back immediately after a TcpClient1.Sendln('str') method), but we cannot
understand who will get back the Server answer.

In our tries:
1) we call TcpClient1.Open method
2) check(on the Server) that the socket is opened correctly, but the event
TcpClient1Connect(Sender: TObject) is NOT raised
3) a TcpClient1Error(Socket Error = 10035) received.
4) then we call sequentially TcpClient1.Sendln('str') and
TCPClient1.Receiveln(#13#10) (Receiveln returned string is empty)
5) check(on the Server) that the 'str' is arrived, but the event
TcpClient1Receive(Sender: TObject; Buf: PAnsiChar;
  var DataLen: Integer) is NOT raised
6) if after some time we call a TCPClient1.Receiveln(#13#10) again, its
returned string contain the aspected value and the TcpClient1Receive event
is raised

How the TcpClient should work?

Thanks in advance
gianluca

Replies:

www.cryer.info
Managed Newsgroup Archive