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 

How to suspend Socket Message Dialog ?

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





PostPosted: Fri Feb 20, 2004 1:38 am    Post subject: How to suspend Socket Message Dialog ? Reply with quote



Hi,

I have wrote a 7x24 real-time program and upload some text file to a FTP
server for a period of time (Timer1). But, sometimes TIdFTP ( Indy
ver9.0.14 ) will raise the some socket errors (e.g. Resolving hostname
error, Connection timeout and etc.) and I allow the program that will
ignore error(s) and upload the text file later.

procedure TForm1.Timer1Timer(Sender: TObject);
begin
try
with idFTP1 do begin
if not connected then connect;
if connected then begin
Put(cFileName, 'data.txt');
Disconnect;
DisconnectSocket;
end;
end;
except
// Do nothing and ignore.
end;
end;

But, the program, TIdFTP, will still raise the Socket error message
dialog box. Would you give me some advice to suspend such dialog box ?

THX.

Regards,
Nelson.

Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Fri Feb 20, 2004 3:58 am    Post subject: Re: How to suspend Socket Message Dialog ? Reply with quote




"Nelson Chui" <nelson_chui (AT) yahoo (DOT) com> wrote


Quote:
Disconnect;
DisconnectSocket;

You do not need to call both methods. Just call Disconnect only. It will
call DisconnectSocket() internally.

Quote:
But, the program, TIdFTP, will still raise the Socket error
message dialog box.

No, it will not. The code you have shown is fine. The only way such a
dialog could appear is if you are running the program inside the IDE
debugger and are actually seeing the debugger's popup dialog, which is
perfectly normal behavior.


Gambit



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.