Socket Error #10054

Giganews Newsgroups
Subject: Socket Error #10054
Posted by:  Stephan Leiwering, AdvanTex Software (leiwering [AT] advantex [DOT] de)
Date: Wed, 31 Aug 2005

I have an issue when deleting POP3 messages.
I am using D7, Indy 9.00.0.03.
This is basically what I do:

  POP := TIdPop3.Create (nil);
  try
    POP.Host    := GetSetting('INVENTUR_POP3_SERVER');
    POP.Username := GetSetting('INVENTUR_POP3_USERNAME');
    POP.Password := GetSetting('INVENTUR_POP3_PASSWORD');
    try
        POP.Connect;
        while POP.CheckMessages > 0 do begin
          Inc(iMsg);
          Msg := TIdMessage.Create(self);
          try
            If POP.Retrieve(iMsg, msg) then Begin
              // process mail...
              POP.Delete(iMsg);
            End;
          finally
            Msg.Free;
          end;
        end;
      except
        on E: Exception do
          // ...
      end;
  finally
      POP.Disconnect;
      POP.Free;
  end;

I get the error in line
  POP.Delete(iMsg);

It occurs quite often but not always.
Any help is highly appreciated!

Stephan

Replies