Results 1 to 3 of 3

Thread: How to end reading POP3 server's response before its actual end, is this a good idea?

  1. #1
    Join Date
    Feb 2010
    Posts
    68
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default How to end reading POP3 server's response before its actual end, is this a good idea?

    In my program, I'm sending a command: "TOP X 200" to a POP3 server, for every mail from a given mailbox (X is the number of the mail), because I want to gather information about the mail's subject and attachment name. But in a lot of cases I don't need all these 200 lines because information I need are in, let's say, first 80 lines of a response for such a TOP command. While reading the response from the server, if I will find out that I already have the information I need and there are still 120 lines to read - do I must read them or is there a way to stop reading and going to the next mail? If so, how to do it and is it at least worth anything?

  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: How to end reading POP3 server's response before its actual end, is this a good i

    You can't just stop a data stream unless there's a command to let the server know how many lines you want or to stop sending.

    In these cases, you can set the read buffer size, or count the lines when you're receiving the packets.
    If you've read the buffer (when setting the size) or are at 80 lines, just disconnect from the server.

    This, however comes at a cost!
    If the server requires a log in, you do need to connect and log in again. In some cases, the extra overhead of establishing the connection again might be too costly and reading all the data might be quicker.

  3. #3
    Join Date
    Feb 2010
    Posts
    68
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to end reading POP3 server's response before its actual end, is this a good i

    Thank you for such a quick reply. I think I'll just try to figure out what is the minimal number of lines which I must ask for to gather the information I need. Thanks again.

Similar Threads

  1. response from mail server
    By zakis in forum Qt Programming
    Replies: 4
    Last Post: 25th September 2009, 05:32
  2. Is creating yet another IDE a good idea?
    By piotr.dobrogost in forum Qt Tools
    Replies: 20
    Last Post: 31st July 2009, 07:38
  3. Replies: 1
    Last Post: 16th July 2009, 02:25
  4. Replies: 2
    Last Post: 8th September 2006, 11:35

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.