Results 1 to 3 of 3

Thread: [QtTelnet] Large responses should be not piecewise, want single message

  1. #1
    Join Date
    Dec 2008
    Posts
    16
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default [QtTelnet] Large responses should be not piecewise, want single message

    Is there an EndOfFile as a *response* from the telnet server? I want to check large responses as a whole, while QtTelnet sends its sliced in multiple message(const QString&) signals. But then I dont know how many messages will come, where is the end ? I am just playing with the example simpleCient in the solution package, but want to depart from it.

    The underlying socket might help? In perl I used to regexp the next prompt, but thats fishy.

    Any hint?

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: [QtTelnet] Large responses should be not piecewise, want single message

    There's the QtTelnet::EndOfFile flag.
    You can check for it. Check the Telnet RFC.

    Or, if you use the Telnet session to communicate with antoher protocol it depends on the protocol.
    If you use HTTP in your telnet session, the the size is in the headers.
    If you use NNTP then a multiline message ends with \r\n.\r\n
    Last edited by tbscope; 22nd June 2010 at 04:37.

  3. #3
    Join Date
    Dec 2008
    Posts
    16
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QtTelnet::EndOfFile where to receive ? Docs say its only for sending ?

    The doc says its only for sending, but I need to receive it:

    QtTelnet::EndOfFile 7 Sends the END OF FILE control message.
    sendControl(QtTelnet::EndOfFile)

    I tried to check the underlying socket, but that only gave me an empty buffer (supposedly already flushed inside of QtTelnet):

    class TelnetClientDialog
    {
    QtTelnet t; // logged in etc

    TelnetClientDialog()
    {
    connect( t, ..message.., this, ..slotReceiveMessage.. );
    }

    void slotReceiveMessage(const QString &msg)
    {
    QByteArray data = t->socket()->readAll();
    qDebug() << "bytesArray=" << data;
    qDebug() << "bytesArray eof=" << data.indexOf( '\0' );
    }
    };

    data is "" and indexOf says -1

Similar Threads

  1. QUdpSocket not getting responses
    By mhoover in forum Qt Programming
    Replies: 2
    Last Post: 8th July 2009, 01:40
  2. To large exe file
    By wydesenej in forum Installation and Deployment
    Replies: 8
    Last Post: 24th January 2009, 21:44
  3. Replies: 4
    Last Post: 12th October 2008, 13:47
  4. Sending large datagrams(very large)
    By marcel in forum General Programming
    Replies: 1
    Last Post: 16th February 2008, 21:55
  5. open large file in qt?
    By vishal.chauhan in forum Qt Programming
    Replies: 11
    Last Post: 29th May 2007, 07:25

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.