Menu

#64 smtpmail not always sending in batch-mode

open
nobody
5
2004-05-13
2004-05-13
No

I ran into a problem with smtpmail.p running in a
batch-environment:

Occasionally the e-mail would not be sent, and
smtpmail.p seems to hang. After 60 seconds it times
out. Running it again sent the e-mail immediately.

I think the problem is with the PAUSE statement within
the "DO WHILE sending" loop if you're running in batch
mode. The loop sets a timer for 60 seconds, and
processes events every second. It looks almost like the
event sometimes gets lost. I commented out the PAUSE 1,
and it seems to work every single time.

This has an added benefit: there doesn't seem to be a
need to make a distinction between running in batch and
not. Since the event is now processed almost as soon as
it arrives, the only test we need to do is see if we're
running persistent. So after all these mods, my "wait"
code after creating the socket looks like this
(comments deleted for brevity - sorry Paul & Simon...:):

IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
start-etime = ETIME.
DO WHILE sending:
PROCESS EVENTS.
IF start-etime + 60000 < ETIME THEN DO:
ASSIGN
sending = NO
vmessage = "Connection Timed out".
{&LOGGER} "Connection Timed out." SKIP.
RUN Cleanup.
END.
END.
END.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB