Alaska Software Inc. - timeout
Username: Password:
AuthorTopic: timeout
Stephan Koenigtimeout
on Thu, 27 Mar 2003 08:09:19 -0500
Hi,

I am trying to send a mail using ASINET to a specific destination. I need to
send directly.

Does to havy traffic at the other end, the connection gets established, but
its a while until the "welcome" answer comes. In this case ASINET comes back
with a timeout on the SMPT send.

The other ends claims that this is not correct and I should just wait more
time. Test show that all Mailservers I tested just wait longer.

This is what I found in the RFCs:

Based on extensive experience with busy mail-relay hosts, the
minimum per-command timeout values SHOULD be as follows:

  Initial 220 Message: 5 minutes

A Sender-SMTP process needs to distinguish between a
failed TCP connection and a delay in receiving the initial
220 greeting message.  Many receiver-SMTPs will accept a
TCP connection but delay delivery of the 220 message until
their system load will permit more mail to be processed.



What can I do to extend the wait time ?

Stephan
Stephan KoenigRe: timeout
on Thu, 27 Mar 2003 08:18:40 -0500
this is how I send ....

if oSmtp:connect()
   if oSmtp:send( oMail )
      ? "Message sent"
   else
      ? "Unable to deliver message"
   endif
   oSmtp:disconnect()
else
   ? "Unable to connect to mail server"
endif
Scott SmithRe: timeout
on Thu, 27 Mar 2003 06:50:39 -0800
I just put a loop... so if it doesn't connect, it waits and trys again. If
it doesn't send, it waits and trys again. I run this in it's own thread so
the user and/or application can go about other business.

If after "x" number of failures, you can take whatever action is appropriate
for the application like logging the error to a file and/or writting to the
windows event log and/or warning the user, etc.
Stephan KoenigRe: timeout
on Thu, 27 Mar 2003 10:09:32 -0500
> for the application like logging the error to a file and/or writting to
the

Thanks Scott. Understood.

BTW, how do you do logging in a multiuser/multithreat environment ?
Scott SmithRe: timeout
on Thu, 27 Mar 2003 17:11:47 -0800
On "how to log in a multi-use, multi-threaded environment":

You can log to a DBF or other supported table using the scheme of the target
database.

To log to a text file, I check if the log file exists, if not I create it
(see fcreate()). I do a loop around opening the file for write access
(thereby "locking" the file) ( fopen( cfilename, FO_WRITE) ), if successful,
I loop attempting to write the string ( fwrite( nhandle, cstring ) ) to the
end of the file. See the "file functions" in the xbase++ help file. It's
possible to get into a deadlock situation with this approach, so I only try
"x" number of times waiting between each attempt, if unsuccessful you can
display the info for the user. However, deadlock should be extremely rare.

Logging to the OS event log requires windows API work and there is some
complication around authentication. However, it is doable with the correct
implementation. I've not done this yet personally.

E-mail is Phil Idle's suggestion and a very good one. Almost everyone has a
working e-mail account these days and the delivery, retry, etc of mail boxes
is beefy. However, this does require dependence on other software which I
try to minimize if possible.

"Stephan Koenig" <S.Koenig@LaserPlus.de> wrote in message
news:3e8312c3@asgcom.alaska-software.com...
> > for the application like logging the error to a file and/or writting to
> the
>
> Thanks Scott. Understood.
>
> BTW, how do you do logging in a multiuser/multithreat environment ?
>
>
>
phil@compucar.net Re: timeout
on Thu, 27 Mar 2003 16:00:23 +0000
>What can I do to extend the wait time ?

The solution I use is ridiculously simple.

I run my own mailserver 

I use Mailtraq (http://my.mailtraq.com/). You can download a free
version (up to 4 user accounts).

I setup mailtraq to use MX routing, which delivers the mail direct to
the recipients mailbox.

One advantage of this is that all mail is 'delivered' locally (i.e.
from WAA to the mailserver application), which is about as
instantaneous as you can get. The mailserver then deals with things
like routing and delivery, and the Xbase++ application can get on with
life.

Mailtraq also performs these operations for us:

webmail
nntp
finger
smr
ftp
list-server

It could also be our TCP/IP proxy tunnel.

It's incredibly configurable. By tossing all our mail problems at it,
we don't have to worry about authentication etc.

Regards,

Phil Ide

Xbase++ FAQ
current release: 8,  Monday 4th February 2002, 14:54
***
* Xbase++ FAQ:
*  online  : http://www.idep.org.uk/xbase/xbfaq/xbfaq.htm
*          : www.software-braun.de/xbfaq/xbfaq.htm 
*  download: http://www.idep.org.uk/xbase/xbfaq.zip
*          : www.software-braun.de/xbfaq/xbfaq.zip 
***
Stephan KoenigRe: timeout
on Thu, 27 Mar 2003 11:36:03 -0500
> I run my own mailserver 

Phil,

that was a good one. I run more than mailserver and thats how I solve it for
the moment.

But the task is very time critical and I servers can have tons of mail ....

Stephan
Jose Adriano Baltieri Re: timeout
on Thu, 24 Apr 2003 12:03:29 -0300
Mr Koenig :

    I dont know if this helps you that much but, I have a completely 
different aproach for sending emails.

    What I do is this : the application which wants to send emails, 
simply writes a formatted text file onto a specified directory.

    I use a freeware product, called Mercury, which is a mail server. It 
periodicaly scans that directory and efectively sends the email. It has 
retries and other things to do.

    What do I get with this approach ?

    1) My applications are simple and fast. I can even send emails from 
my old Clipper applications (they only need to know how to do a MEMOWRIT 
or STRFILE). As a matter of fact, I have a doubly compiled function 
SENDMAIL(from,to,subject,message,file to attach) that will write the 
file. It can be called from Clipper or XBase++.

    2) I have a retry mechanism for all of the applications that is 
offered by Mercury server.

    Problem :

    You need to configure a server to run the Mercury Exe. You possibly 
dont wanna do that for all of your clients.

    Hope it may help you, although it is a completely different approach