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 

Delay when creating a new Indy message for the first time in

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





PostPosted: Tue Mar 22, 2005 2:59 pm    Post subject: Delay when creating a new Indy message for the first time in Reply with quote



Hello,

I am developing a mass mailing / mail merge program in C# using Indy 10
for .Net. Everything is working perfectly except for small problem
that I have just been ignoring for a while now.

The first time I initialize a message in my program (i.e.
Indy.Sockets.Message msg = new Indy.Sockets.Message()) there is a long
delay. However, all messages that are created after this first one do
not have the delay. It is really frustrating.

I thought maybe it was just a bug in my program, but I created a simple
test application that shows the same results.

Here is what I did to test it. I created a C# Windows application with
one button and one richtextbox. In the onClick event of the button I
put the following code:

this.Cursor = Cursors.WaitCursor;

DateTime start = DateTime.Now;
Indy.Sockets.Message msg = new Indy.Sockets.Message();
DateTime end = DateTime.Now;

TimeSpan s = new TimeSpan(end.Ticks - start.Ticks);

richTextBox1.Text =
richTextBox1.Text.Insert(richTextBox1.Text.Length,s.Milliseconds.ToString()+"n");

this.Cursor = Cursors.Default;


The first time you click the button, it takes about 5 seconds (although
it displays only ~600 ms) for the Indy.Sockets.Message msg = new
Indy.Sockets.Message() to finish, but in all the subsequent clicks of
the button it is basically instantaneous.

Has anyone else experienced this problem or know how to solve it?

Thanks,
Blake

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.