-----Original Message----- From: eLink Discussion: Development Discussion [mailto:development@elinkkc.opentext.com]Sent: Friday, 18 April 2003 8:53 AMTo: eLink RecipientSubject: help with socket.read help with socket.read Posted by HPcaUser1 (Baghdassarian, Tom) on 04/17/2003 06:52 PM hi,this thing is driving me NUTS!!! I'm trying to make a socket connection to a website to retrieve some html from it, using the sample included in the socket package documentation (see below), what happens is it works on the first call to socket.read (i.e. retrieves the html), but on the next call to socket.read (after all the data has been sent by the web server), the builder shows 'thread released control' - or something like that - cpu goes to 100% and just sits there.problem is, I can't just assume the data will be read by the first socket.read call - e.g. web server may be busy, etc.I can't believe opentext didn't include a nice wrapper for html connections (AND FTP!!!!) - but atleast I'd expect their own samples to work...any help would be greatly appreciated.here's the sample code I'm running (it's from the built-in modules documentation); and yes I can see the data from my connection when I trace it so I know the connection works and the server returns somethings. btw - is there a function such as sleep or wait that I can use - would be very lame but hey, I'm down to my last options here...Socket sock = Socket.Create()Integer nlines = 0String resultSocket.Connect( sock, "www.opentext.com", 80 )Socket.Write( sock, "GET /index.html HTTP/1.0" )Socket.Write( sock, Web.CRLF )Socket.Write( sock, Web.CRLF )Socket.Flush( sock )while ( !IsError( result = Socket.Read( sock ) ) ) Echo( result ) nlines += 1endSocket.Close( sock )Echo( "--Done. Read ", nlines, " lines." )