Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Easy Indy question ?

Posted on 2004-04-07
8
Medium Priority
?
239 Views
Last Modified: 2010-04-05
Hi
what is the best way to close the server-app ( the clients are conneting with it ) with out show the message error .
I use tidtcpserver and tidtcpclient .
thanks
0
Comment
Question by:peruzzi
8 Comments
 
LVL 5

Accepted Solution

by:
delphized earned 200 total points
ID: 10781440
Normally the clients must disconnect first, so you could broadcast a command from the server and in the client program when you receive the close request you disconnect, then in the server program when all the client are disconnected you can close without errors
0
 

Author Comment

by:peruzzi
ID: 10781726
Hi
ok I will do that.....
But
how can I know if there are not any clients connected befor closeing my server ?
I can not close server befor know that all clients are not connected .

thanks
0
 
LVL 5

Expert Comment

by:delphized
ID: 10782516
you have to keep track of them when they connect as in the indy example named chat
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 12

Expert Comment

by:Ivanov_G
ID: 10785721

   When you send a message to the server to close, you can do 2 things :

  1) Set Active = False (this will disconnect you), but the server should process this, and after disconnect all client (even you) should terminate.
  2) MaxConnection = 1 - you will stay connected

  Georgi
0
 

Author Comment

by:peruzzi
ID: 10809198
when I close my application ( do server1.active:=false)
I see this message (terminate thread timeout)

what is the solution for this problem
0
 
LVL 3

Expert Comment

by:MarcG
ID: 10831275
Do you see this message only when running your prog from the IDE (debugging) or is ithis exception raising when the app is running 'normal'.
If it is only inside the IDE you can forget this exception. It is showing any exception when in debug mode, even if it is afterwards handled with a try except.
This happens for some indy components, but the exceptions are normally handled there so you only see them when debugging.
0
 

Author Comment

by:peruzzi
ID: 10840496
this exception raising when the app is running 'normal'
0
 

Author Comment

by:peruzzi
ID: 10912365
Hi guys
thanks for you all
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question