Collecting telnet server responses using lnet. lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- cov · 2011-10-18 14:08 I am trying to telnet to connect to a TiVo DVB-T device. When I send the device a "GET" request, the device responds with several packets. However, lnet will only get the first one. Is there some way I can get lnet to wait for all packets to be received? I am simply sending the "GET" command Code: [Select]Telnet.SendMessage('GET /tvnb?sessionid='+sessID+msg+' HTTP/1.1' + #13#10 + #13#10); And then I'm getting the response with Code: [Select]procedure TFormMain.TelnetReceive(aSocket: TLSocket); var s: string; begin   if Telnet.GetMessage(s) > 0 then     begin       MemoText.Append(s);          end; end; Normally all the header information is carried in the first packet and the data is carried in subsequent packets, but I am only able to read the first packet, although Wireshark tells me that the data packets are being sent too. ---------------------------------------------------------------------- cov · 2011-10-20 15:37 Hmmm. Okay, to clarify, I send this to the device: QuoteGET /tvnb?sessionid=0000001400c2002900&op=channellist&withrating=1 HTTP/1.1 This is actually Frame 73 of the exchange. The device then sends back Frame 74 which is 66 bytes, followed by Frame 75 which contains 85 bytes of data (which I can access using Telnet.GetMessage(s): QuoteHTTP/1.1 200 OK Content-Type: text/plain Content-Length: 892 X-1seg-Result: 14 Frame 76 (66 bytes) is then sent to the device, followed by Frame 77, also 66 bytes. The device then responds with Frame 78 Frame 79, Frame 80, Frame 81, Frame 82 and Frame 83 (each containing 74 bytes), before it finally sends Frame 84 which containst the data I'm interested in, namely 892 bytes of data: Quote1_1_cbms://thomson.net/service/105|00|3|1|||0|1|en|Sony Max 1_1_cbms://thomson.net/service/111|00|3|1|||0|1|en|E! Entertainment Mobile 1_1_cbms://thomson.net/service/108|00|3|1|||16|1|en|Africa Magic 1_1_cbms://thomson.net/service/109|00|3|1|||0|1|en|Channel O 1_1_cbms://thomson.net/service/107|00|3|1|||0|1|en|TRACE Urban 1_1_cbms://thomson.net/service/104|00|3|1|||0|1|en|SuperSport Blitz 1_1_cbms://thomson.net/service/101|00|3|1|||0|1|en|SuperSport 1 1_1_cbms://thomson.net/service/103|00|3|1|||0|1|en|SuperSport 2 1_1_cbms://thomson.net/service/102|00|3|1|||0|1|en|SuperSport 3 1_1_cbms://thomson.net/service/113|00|3|1|||0|1|en|SuperSport 4 1_1_cbms://thomson.net/service/110|00|3|1|||0|1|en|eNews 1_1_cbms://thomson.net/service/112|00|3|1|||0|1|en|CNN 1_1_cbms://thomson.net/service/106|00|3|1|||0|1|en|Cartoon Network 1_1_cbms://thomson.net/service/115|00|3|1|||18|1|en|M-Net Series I want to know how I can access this data. Telnet.GetMessage(s) does not give it to me. I though that it may be an issue with the string, 's' containing a null value which would truncate it, but the actual data doesn't contain any such null character. If I can access Frame 75 using GetMessage, why can I not access Frame 84? ---------------------------------------------------------------------- Almindor · 2011-11-03 14:03 This may be a FPC issue with strings, try using .GET instead of .GETMESSAGE to see if it differs. ---------------------------------------------------------------------- cov · 2011-11-28 08:57 Hi Almindor, Thanks for the response. Is there anywhere I can get the syntax for implementing the GET function? Many thanks ---------------------------------------------------------------------- BigChimp · 2011-11-28 10:39 FYI, you can also have a look at this small telnet client implemented using synapse: http://wiki.lazarus.freepascal.org/Synapse#Requirements