BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

When will indy10 become stabile ?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock
View previous topic :: View next topic  
Author Message
child
Guest





PostPosted: Sun Jan 16, 2005 3:14 pm    Post subject: When will indy10 become stabile ? Reply with quote



Now, simple put a TIdTCPServer to a form,

assign the OnExecute event a line code:

"
beep;
"

then True Active property.

Run this app,

the OnExecute not fire.

when close app, app will error.


Back to top
child
Guest





PostPosted: Sun Jan 16, 2005 4:05 pm    Post subject: Re: When will indy10 become stabile ? Reply with quote



Quote:

the OnExecute not fire.


When client connect it will fire.


Quote:
when close app, app will error.


trace the source, if not close server, then
app will error:

error point:
**********************************************
FreeAndNil(LYarn);
**********************************************

procedure TIdSchedulerOfThread.TerminateYarn(AYarn: TIdYarn);
var
LYarn: TIdYarnOfThread;
begin
LYarn := TIdYarnOfThread(AYarn);
if LYarn.Thread.Suspended then begin
// If suspended, was created but never started
// ie waiting on connection accept
LYarn.Thread.Resume;
**********************************************
FreeAndNil(LYarn);
**********************************************
end else begin
// Is already running and will free itself
LYarn.Thread.Stop;
// Dont free the yarn. The thread frees it (IdThread.pas)
end;
end;




Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Sun Jan 16, 2005 8:41 pm    Post subject: Re: When will indy10 become stabile ? Reply with quote




"child" <jn_child (AT) tom (DOT) com> wrote


Quote:
// If suspended, was created but never started
// ie waiting on connection accept
LYarn.Thread.Resume;
**********************************************
FreeAndNil(LYarn);
**********************************************

You must not be using the latest version, because that code does not appear
in the current version. It looks like this instead:

// If suspended, was created but never started
// ie waiting on connection accept
LYarn.Thread.Free;
FreeAndNil(LYarn);


Gambit



Back to top
child
Guest





PostPosted: Mon Jan 17, 2005 8:01 am    Post subject: Re: When will indy10 become stabile ? Reply with quote

Quote:

You must not be using the latest version, because that code does not
appear
in the current version. It looks like this instead:

// If suspended, was created but never started
// ie waiting on connection accept
LYarn.Thread.Free;
FreeAndNil(LYarn);


Gambit


******************************************

LYarn.Thread.Resume;
******************************************
This line added by me.
when remove this line, app will error also.



Back to top
child
Guest





PostPosted: Mon Jan 17, 2005 11:50 am    Post subject: Re: When will indy10 become stabile ? Reply with quote

Simple:

Put a TCPServer on form,

procedure TForm1.Button1Click(Sender: TObject);
begin
Self.IdTCPServer1.Active := True;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
Self.IdTCPServer1.Active := False;
end;

Press Button1, then
Press Button2, will cause error.


Back to top
child
Guest





PostPosted: Mon Jan 17, 2005 12:16 pm    Post subject: Re: When will indy10 become stabile ? Reply with quote

Solution:

// Add
LYarn.Thread.Resume;
LYarn.Thread.Free;
// remove FreeAndNil(LYarn);

When LYarn.Thread.Free, it should will free the yarn.


procedure TIdSchedulerOfThread.TerminateYarn(AYarn: TIdYarn);
var
LYarn: TIdYarnOfThread;
begin
LYarn := TIdYarnOfThread(AYarn);
if LYarn.Thread.Suspended then begin
// If suspended, was created but never started
// ie waiting on connection accept
LYarn.Thread.Resume;
LYarn.Thread.Free;
// FreeAndNil(LYarn);
end else begin
// Is already running and will free itself
LYarn.Thread.Stop;
// Dont free the yarn. The thread frees it (IdThread.pas)
end;
end;



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.