Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Indy | Client threads

Posted on 2004-08-01
4
Medium Priority
?
192 Views
Last Modified: 2010-04-05
Hello,

If I have a IdTCPServer on my server app, and then have the IdTCPClient on the clients, should I
"Connect" to the server, do what I need to do, "disconnect" and "connect" later if I need to send more information to the server
or
"Connect" to the server, do statements... and leave the connection open until client app closes?

Thanks in advance...

Cërf.
0
Comment
Question by:Cerf
[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
  • 2
4 Comments
 
LVL 4

Accepted Solution

by:
ceoworks earned 700 total points
ID: 11690162
Hi Cerf,

<should I "Connect" to the server, do what I need to do, "disconnect" and "connect" later if I need to send more information to the server or "Connect" to the server, do statements... and leave the connection open until client app closes?>

It depends on your needs. For example if you are developing a simple chat system, you should let them stay connected because in chat system, there will be a tons of message transfer between clients and server. So it wouldn't be a good idea to connect, send message then close. But if have an application which needs to send some data by the timer(for example once per 5 min..), you may think to :

(i) connect
(ii) transfer data
(iii) disconnect

HTH,

Oktay
0
 
LVL 8

Author Comment

by:Cerf
ID: 11691021
So, it doesn't really matter in a "safe" enviroment as a LAN...
I guess, I will go with "connect->transfer data-> do other stuff-> disconnect" since users should be done within a couple of minutes...

Thanks, Oktay.

I am interested in listening another opinion or two, so I will leave the Q open for one more day.
0
 
LVL 17

Assisted Solution

by:Wim ten Brink
Wim ten Brink earned 700 total points
ID: 11694019
Connecting every time will slow things down a bit thus it is advised to keep the connection open if you need to make many small transactions, like e.g. a chat program. However, if the amount of traffic isn't big or if you have limited bandwidth, it might be more useful to close connections again to free more resources while you don't need the connection.Keeping a connection closed is also useful because you might switch between servers that way. Thus, when you connect to System X and system X fails to connect, you connect to system Y instead. Close again and for the next call, Y might be busy so you connect to Z. (Or back yo X.)

Keeping the connection open is useful for chat programs. Keeping it closed is more useful for stuff like mail applications and webbrowsers.

If this is within a private LAN then internal bandwidth can be a problem if these are connections to a single server. If 500 employees are all connected at the same server then the server has a lot of resources in use, even if none of the users are exchanging data with it. Then again, the average, modern server should be able to handle such a low amount of users anyway...
0
 
LVL 8

Author Comment

by:Cerf
ID: 11695445
SO I guess I'm cool with having them open since it is a lab LAN, with a very few machines (no more than 20)
Thank you guys,
I am satisfied with your opinions,

Cërf.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
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…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

722 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