This seems to belong to the self inflicted injury type.
I have made 2 changes in my app that seem to have made a positive impact (although only in test for about an hour, where previously stability issues were occuring within that timeframe).
The addition of a try except block in my onConnect event
and removed the
TmySmtpItem(AThread.Data).LastEvent := 'WwolSmtpServListenException ' + AException.ClassName + ' - ' + AException.message;
statement from the onListenException event.
One or both of these appear to have made a positive impact. I presume it must be the later as that impacts the Listener threads.
-Allen
I have made 2 changes in my app that seem to have made a positive impact (although only in test for about an hour, where previously stability issues were occuring within that timeframe).
The addition of a try except block in my onConnect event
Code:
procedure TdSmtpServ.WwolSmtpServConnect(AContext: TIdContext);
var
HostName : string;
begin
dmServiceSupport.SenderCS.Acquire;
try
inc(unique_id);
finally
dmServiceSupport.SenderCS.Release;
end;
try
AContext.Connection.Socket.ReadTimeout := 15000;
AContext.Data := TmySmtpItem.Create(unique_id, 'WwolSmtpServConnect', AContext.Binding.PeerIP, AContext.Binding.IP, AContext.Connection.ClassName, HostName);
Log(now, 0, -4, AContext.Binding.IP, AContext.Binding.PeerIP, '[' + IntToStr(TmySmtpItem(AContext.Data).Id) + '] - ' + 'WwolSmtpServConnect',
'[' + IntToStr(TmySmtpItem(AContext.Data).Id) + '] - ' +
' WwolSmtpServConnect connected at ' + DateTimeToStr(TmySmtpItem(AContext.Data).Start) +
' - ' + TmySmtpItem(AContext.Data).ThreadName +
' - SourceIP: ' + TmySmtpItem(AContext.Data).SourceIP +
' - DestIP: ' + TmySmtpItem(AContext.Data).DestIP +
' - ' + TmySmtpItem(AContext.Data).LastEvent);
except
on E: Exception do
begin
Log(now, 0, -4, AContext.Binding.IP, AContext.Binding.PeerIP, '[' + IntToStr(unique_id) + '] - ' + 'WwolSmtpServConnect EXCEPTION',
'[' + IntToStr(unique_id) + '] - ' +
' - SourceIP: ' + AContext.Binding.PeerIP +
' - DestIP: ' + AContext.Binding.IP +
' - Connect EXCEPTION: ' + E.Message);
end;
end;
end;
and removed the
TmySmtpItem(AThread.Data).LastEvent := 'WwolSmtpServListenException ' + AException.ClassName + ' - ' + AException.message;
statement from the onListenException event.
One or both of these appear to have made a positive impact. I presume it must be the later as that impacts the Listener threads.
-Allen