Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Should I retry some commands during a POP3 session?

session

  • Please log in to reply
7 replies to this topic

#1 kremuwa

kremuwa

    CC Lurker

  • Just Joined
  • Pip
  • 5 posts

Posted 14 July 2010 - 03:27 AM

Hello,

I'm writing a peer2mail client. To connect to the mailboxes I use pop3 protocol. I'm connecting to a pop3 server and downloading some mails using commands like:
- USER
- PASS
- STAT
- TOP
- RETR

I want the program to be as reliable as possible. I'd like to ask you then, if I should retry sending some commands in case of their failure. If so, which of them and how many times? Should I retry the connection to pop3server itself?

Thank you in advance for your effort,
Michael. :)
  • 0

#2 kremuwa

kremuwa

    CC Lurker

  • Just Joined
  • Pip
  • 5 posts

Posted 16 July 2010 - 10:22 PM

Refresh.
  • 0

#3 WingedPanther73

WingedPanther73

    A spammer's worst nightmare

  • Moderator
  • 17757 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others

Posted 17 July 2010 - 03:58 AM

What you should do is act properly based on the protocol, not just randomly resend commands.
  • 0

Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

My MineCraft server site: http://banishedwings.enjin.com/


#4 kremuwa

kremuwa

    CC Lurker

  • Just Joined
  • Pip
  • 5 posts

Posted 17 July 2010 - 04:01 AM

My program works well, I do it properly but sometimes for example RETR function is failing from unknown reason - when I start again, it works. So I came to think I should retry some commands if they fail - that's the reason of my question.
  • 0

#5 WingedPanther73

WingedPanther73

    A spammer's worst nightmare

  • Moderator
  • 17757 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others

Posted 17 July 2010 - 04:54 AM

Is it a network issue, perhaps?
  • 0

Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

My MineCraft server site: http://banishedwings.enjin.com/


#6 kremuwa

kremuwa

    CC Lurker

  • Just Joined
  • Pip
  • 5 posts

Posted 17 July 2010 - 04:59 AM

You may be right. I think it'll be good to retry sending RETR comand in the case of its failure, because it takes a lot of time to read a response for such a command and issues are more possible... maybe?
  • 0

#7 WingedPanther73

WingedPanther73

    A spammer's worst nightmare

  • Moderator
  • 17757 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others

Posted 17 July 2010 - 05:15 AM

You may want to try diagnosing it with a command-line telnet prompt, to see what's happening.

Things that cross my mind: Are you sure you're still in a TRANSACTION state when issuing RETR? What's the exact response that indicates failure? If the connection is interrupted or times out, that would cause you to lose the TRANSACTION state, and make RETR an invalid command, for example.
  • 0

Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

My MineCraft server site: http://banishedwings.enjin.com/


#8 kremuwa

kremuwa

    CC Lurker

  • Just Joined
  • Pip
  • 5 posts

Posted 17 July 2010 - 10:07 AM

I will let you know as soon as I get this error again.
  • 0





Also tagged with one or more of these keywords: session

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download