Solved

Easy Indy question ?

Posted on 2004-04-07
8
231 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 50 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

919 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now