Re: [twsocket] pop3 component not ready - Bug in TPop3Cli

2008-01-18 Thread Arno Garrels
DZ-Jay wrote:
> Can you post some code so that we know how you tried to fix it?

The bug I found is the "Special processing for Quit" below.

procedure TCustomPop3Cli.TriggerRequestDone(Error: Word);
begin
==> (*  
{ Special processing for Quit (Roger Morton 24-12-99) }
if FRequestType = pop3Quit then begin
if FWaitingOnQuit then
{ When the second RqDone arrives (from WSocketSessionClosed),   }
{ treat it as a normal event by setting a zero Error code   }
Error := 0
else begin
{ When the first RqDone arrives, set the FWaitingOnQuit flag so }
{ we're ready to handle a second RqDone.}
{ Take no other action (in particular, we don't advise the user }
{ that the first RqDone has happened)   }
FWaitingOnQuit := True;
Exit;
end;
{ Fall down here for all normal RqDone, and after the second RqDone }
{ following a Quit  }
FWaitingOnQuit := False;
end;
==> *)

This code prevents that RequestDone fires in case the server doesn't
send a response to the Quit command, and thus the Pop3State is never reset
properly.

--
Arno Garrels [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html





-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] pop3 component not ready - Bug in TPop3Cli

2008-01-18 Thread DZ-Jay

On Jan 17, 2008, at 07:34, [EMAIL PROTECTED] wrote:

> it didnt fix the issue, got a pop3 not ready exception today.

Can you post some code so that we know how you tried to fix it?

dZ.

-- 
DZ-Jay [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] pop3 component not ready - Bug in TPop3Cli

2008-01-17 Thread Arno Garrels
[EMAIL PROTECTED] wrote:
> AG> It helps alot to post a short message when you either think
> AG> the problem is resolved or not. Thanks.
> 
> it didnt fix the issue, got a pop3 not ready exception today.

You did not provide any further information, "not ready exceptions"
may happen, i.e. due to incorrect component use. So I'm helpless.
I use TPop3Cli in an NT service application that checks for and
downloads mails in intervals since several years now w/o any problem.
However I'm starting a new session by calling Abort (to work around
the bug I mentioned), this works very reliable though it's not nice.

--
Arno Garrels [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html


> 
> 
> 
> AG> --
> AG> Arno Garrels [TeamICS]
> AG> http://www.overbyte.be/eng/overbyte/teamics.html
> 
> 
> 
>>> 
>>> i also hope that the bug gets eliminated in the next release by
>>> FPIETTE.
>>> i don't really like using custom-patched components.
> 
> 
> 
> --
> Mit freundlichen Grüßen
> [EMAIL PROTECTED]
> mailto:[EMAIL PROTECTED]
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] pop3 component not ready - Bug in TPop3Cli

2008-01-17 Thread retnyg

AG> It helps alot to post a short message when you either think
AG> the problem is resolved or not. Thanks.

it didnt fix the issue, got a pop3 not ready exception today.



AG> --
AG> Arno Garrels [TeamICS]
AG> http://www.overbyte.be/eng/overbyte/teamics.html



>> 
>> i also hope that the bug gets eliminated in the next release by
>> FPIETTE.
>> i don't really like using custom-patched components.



-- 
Mit freundlichen Grüßen
[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]


-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] pop3 component not ready - Bug in TPop3Cli

2007-12-12 Thread Arno Garrels
[EMAIL PROTECTED] wrote:
> thanks arno and dz-jay, i hope that'll fix it.

It helps alot to post a short message when you either think
the problem is resolved or not. Thanks.

--
Arno Garrels [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html



> 
> i also hope that the bug gets eliminated in the next release by
> FPIETTE.
> i don't really like using custom-patched components.
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] pop3 component not ready - Bug in TPop3Cli

2007-12-12 Thread retnyg
thanks arno and dz-jay, i hope that'll fix it.

i also hope that the bug gets eliminated in the next release by
FPIETTE.
i don't really like using custom-patched components.

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] pop3 component not ready - Bug in TPop3Cli

2007-12-12 Thread Arno Garrels
[EMAIL PROTECTED] wrote:

> as you see, the pop component is not connected when i do the connect
> cmd. that's the strange thing, the connection is closed but the
> component is not in a ready state.

Sorry, now I recall that there is a BUG in the component since a long
time!! I fighted for getting this fixed, however the bug is still present.
 
What happens in your case is that GMX doesn't send a response to the
QUIT command but closes the connection at once. 

The bug is the "Special processing for Quit" below, comment that out
and rebuild all. 

procedure TCustomPop3Cli.TriggerRequestDone(Error: Word);
begin
==> (*  
{ Special processing for Quit (Roger Morton 24-12-99) }
if FRequestType = pop3Quit then begin
if FWaitingOnQuit then
{ When the second RqDone arrives (from WSocketSessionClosed),   }
{ treat it as a normal event by setting a zero Error code   }
Error := 0
else begin
{ When the first RqDone arrives, set the FWaitingOnQuit flag so }
{ we're ready to handle a second RqDone.}
{ Take no other action (in particular, we don't advise the user }
{ that the first RqDone has happened)   }
FWaitingOnQuit := True;
Exit;
end;
{ Fall down here for all normal RqDone, and after the second RqDone }
{ following a Quit  }
FWaitingOnQuit := False;
end;
==> *)

This code prevents that RequestDone fires in case the server doesn't
send a response on the Quit command, and thus the Pop3State is never reset
properly.  

After you outcommented this code try the little test program below, don't
run it w/o a break point since it would reconnect in a loop infinitely.


unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Pop3Prot, StdCtrls;

const
  WM_RECONNECT = WM_USER + 1;

type
  TForm1 = class(TForm)
Button1: TButton;
Pop3Cli1: TPop3Cli;
procedure Pop3Cli1RequestDone(Sender: TObject; RqType: TPop3Request;
  Error: Word);
procedure Button1Click(Sender: TObject);
  protected
procedure WmReconnect(var Msg: TMessage); Message WM_RECONNECT;
  public
{ Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
Pop3Cli1.Connect;
end;

procedure TForm1.WmReconnect(var Msg: TMessage);
begin
Pop3Cli1.Connect;
end;

procedure TForm1.Pop3Cli1RequestDone(Sender: TObject; RqType: TPop3Request;
  Error: Word);
begin
case RqType of
pop3Connect : 
if (Error = 0) then
TPop3Cli(Sender).Quit;

pop3Quit :
begin
{ Regardless of Error or not Error }
if TPop3Cli(Sender).Connected then
TPop3Cli(Sender).Abort // No problem here since the server 
sent the response
else // Post a custom message if you want to reconnect
PostMessage(Handle, WM_RECONNECT, 0, 0);
end;
end;
end;

end.

--
Arno Garrels [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html




> 
> 
> 
> AG> [EMAIL PROTECTED] wrote:
>>> procedure TMailAlert.Pop3ClientRequestDone;
>>> begin
>>>   if (FPop.connected) and (CheckError) then begin
>>> FPop.quit;
>>> exit;
>>>   end;
>>> 
>>> ...
>>> 
>>> what could be the cause that the component is not ready after the
>>> error ?
> 
> AG> After sending command Quit you should receive a server response.
> AG> When it's received you may either close or abort the connection
> AG> yourself or wait until the server drops the connection.
> AG> Anyway start next connection attempt only when you are not
> connected, 
> AG> means after SessionClosed fired.
> 
> AG> --
> AG> Arno Garrels
> 
> 
> 
> 
> --
> Mit freundlichen Grüßen
> [EMAIL PROTECTED]
> mailto:[EMAIL PROTECTED]
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be