Solved

Easy Indy question ?

Posted on 2004-04-07
8
235 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

734 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