11-09-2018, 02:36 PM
Hi,
I have TidSmtpServer setup and running, it runs fine for a period of time, then stops responding. When I set the server active := True it creates 2 threads for each IP binding I have made. Each of these IP's do for a period of time handle incomming requests as expected. Then slowly each IP stops responding to external requests and the 2 threads created when the server was set to active appear to terminate.
The bindings all are still set, and restarting to server (Active set to False then True) does not solve the problem.
I presume that since it is the Listener Threads that are failing we should expect to see the onListenException be fired when that occurs, however I never see this get called.
My bindings are created as follows
And myver config is set as follows
Any pointers on where to look would be most welcome
-Allen
I have TidSmtpServer setup and running, it runs fine for a period of time, then stops responding. When I set the server active := True it creates 2 threads for each IP binding I have made. Each of these IP's do for a period of time handle incomming requests as expected. Then slowly each IP stops responding to external requests and the 2 threads created when the server was set to active appear to terminate.
The bindings all are still set, and restarting to server (Active set to False then True) does not solve the problem.
I presume that since it is the Listener Threads that are failing we should expect to see the onListenException be fired when that occurs, however I never see this get called.
Code:
procedure TdSmtpServ.WwolSmtpServListenException(AThread: TIdListenerThread; AException: Exception);
begin
Log(now, 0, -9, AThread.Binding.IP, AThread.Binding.PeerIP, AException.ClassName, '[' + IntToStr(TmySmtpItem(AThread.Data).Id) + '] - ' +
AException.message + ' - WwolSmtpServListenException');
TmySmtpItem(AThread.Data).LastEvent := 'WwolSmtpServListenException ' + AException.ClassName + ' - ' + AException.message;
end;
Code:
procedure TdSmtpServ.SetBoundIp(ServerId: integer);
var
Query : TMyQuery;
zConn1 : TMyConnection;
myBinding : TIdSocketHandle;
begin
Query := TMyQuery.Create(nil);
zConn1 := TMyConnection.Create(nil);
try
try
dmMain.SetDBReadcomp(zConn1, Query, 'SetBoundIp');
if not zConn1.connected then
dmMain.ConnectToDB(zConn1, 'SetBoundIp');
with Query do
begin
SQL.Text := 'SELECT idIPmanager, InternalIP, PublicIP, ReverseDnsName, ServerId, Active ' + ' FROM ipmanager ' + ' WHERE Active = True and ServerId = ' + IntToStr(ServerId)
+ ';';
Open;
First;
while not Eof do
begin
myBinding := WwolSmtpServ.Bindings.Add;
myBinding.Port := 25;
myBinding.IP := Query.FieldByName('InternalIP').AsString;
myBinding.DisplayName := Query.FieldByName('ReverseDnsName').AsString;
Next;
end;
end;
except
on E: Exception do
begin
Log(now, 0, -1, 'SetBoundIp', myBinding.IP, E.ClassName, E.message + ' - ' + ' SetBoundIp');
end;
end;
finally
Query.Free;
zConn1.Disconnect;
zConn1.Free;
end;
end;
Code:
with WwolSmtpServ do
begin
ReuseSocket := rsOSDependent;
AllowPipelining := True;
ServerName := 'WWOL SMTP server';
DefaultPort := 25;
ListenQueue := 50;
MaxConnections := 0;
MaxMsgSize := 0;
UseNagle := True;
UseTLS := utNoTLSSupport;
Intercept := nil;
IOHandler := nil;
end;
Any pointers on where to look would be most welcome
-Allen