Reusing a pop3socket

  1. 2 years ago

    antonio c

    7 Dec 2016 Pre-Release Testers, Xojo Pro Italy

    Hi all
    I am using a pop3securesocket just to check the messages via retrieve lines.
    When I am finished using it or I click in a button to stop the check, I disconnect the socket and the event gets fired
    Next I close the socket (closing the socket or not leads to same result.
    The problem arises when I try to reuse the socket
    It connects via the relative event and I get from the server a wrong command error, like it wasn't disconnected earlier.
    Any help would be greatly appreciated.
    Antonio

    Unfortunately it's the only way to know that the socket is in a clean state when you want to use it again.

  2. Greg O

    8 Dec 2016 Xojo Inc Somewhere near Raleigh, NC

    It's likely that the internal state of the socket isn't getting reset. You should file a bug report and we'll look at it.

    In the mean time, you could just re-initialize the socket from scratch.

  3. Maybe it is the same problem I encountered years ago (I think 2012). Unfortunately I cannot find the relevant post on this forum.
    And I did not file a bug report because the problem could not be reproduced consistently.
    Anyway, from that time my workaround has been to put the socket in its own window (let's call it pop3Win), then: from the main window, call pop3Win when accessing the first account; close it when the socket job is done; reopen pop3Win from the main window to access the second account, and so on and so forth.

    In the error event of the pop3socket in pop3Win:
    if ErrorCode = 22 then
    //MsgBox "err 22"
    Return
    end if

  4. antonio c

    26 Dec 2016 Pre-Release Testers, Xojo Pro Italy

    Thanks for the replies
    Only way I found to solve the problem was to call disconnect and purge from inside the control. calling it from outside yielded the errors in the previous post.

    Thanks for your support

  5. 4 months ago

    antonio c

    Mar 18 Pre-Release Testers, Xojo Pro Italy

    after almost 2 year the bug it's still there and what's worse my workaround doesn't work anymore.
    I guess if problem won't be resolved very soon I'll have to rewrite my app almost from scratch.

  6. Greg O

    Mar 19 Xojo Inc Somewhere near Raleigh, NC

    @antonio c after almost 2 year the bug it's still there and what's worse my workaround doesn't work anymore.
    I guess if problem won't be resolved very soon I'll have to rewrite my app almost from scratch.

    Did you file a bug report in Feedback like I suggested?

  7. antonio c

    Mar 19 Pre-Release Testers, Xojo Pro Italy

    Unfortunately I didn't

  8. Peter J

    is not verified Mar 19 KwaZulu-Natal, South Africa

    First - I have never used a pop3socket, so I might be off on the wrong track.

    This might apply:
    http://www.serverframework.com/asynchronousevents/2011/01/time-wait-and-its-design-implications-for-protocols-and-scalable-servers.html

    In my experience - never re-use an outbound socket. Just create a new one.

  9. 2 weeks ago

    antonio c

    Jul 8 Pre-Release Testers, Xojo Pro Italy
    Edited 2 weeks ago

    @Greg OLone It's likely that the internal state of the socket isn't getting reset. You should file a bug report and we'll look at it.

    In the mean time, you could just re-initialize the socket from scratch.

    How could I reinitialise the socket?

    Bug its still there obviously

    Thank you

    Antonio

  10. last week

    Greg O

    Jul 9 Xojo Inc Somewhere near Raleigh, NC

    @antonio c How could I reinitialise the socket?

    Bug its still there obviously

    Thank you

    Antonio

    Reinitialize by creating a new instance. Each time you need to use it,

    Dim s as new pop3securesocket
  11. antonio c

    Jul 9 Pre-Release Testers, Xojo Pro Italy

    Thanks for your reply Greg, but this way I’ll lose all the code I initially wrote
    I worked around it subclassing the control and adding handlers for the events needed.
    But it was quite a long job
    Thanks

  12. Greg O

    Jul 11 Xojo Inc Answer Somewhere near Raleigh, NC

    Unfortunately it's the only way to know that the socket is in a clean state when you want to use it again.

or Sign Up to reply!