Article View: borland.public.cppbuilder.internet.socket
Article #2058Re: Would Indy's TIdTCPServer have any problem with connections I never read from?
From: Lesley Anne
Date: Wed, 30 Aug 2006 17:10
Date: Wed, 30 Aug 2006 17:10
45 lines
3224 bytes
3224 bytes
> The server itself never checks the state of its client > connections. Instead, it relies on the OnExecute event handler > to disconnect the sockets, or otherwise perform reading/writing > operations on the sockets so that Indy can detect disconnects at > the API layer, which will then cause the reading/writing operations > to throw an exception that the server can use to terminate the > managing thread and clean up the socket. So, if the disconnect will be coming from the client's end of the connection, is the best way to make sure the component recognizes that disconect to periodically try to read from all connections, trusting that they'll error out correctly when the connection is no longer active? I thought at first that would be simple enough to do, but I'm having a hard time finding how to even access all the (apparent) connections. The best I could come up with to even see how many connections I have is Server1->Bindings->Items->Collection->Count, but that seems like more layers of properties than would generally be used for something so fundamental, so I'm assuming I may have missed something. How would you normally tell an application to do something with each connection on a TIdTCPServer? > Are all of the applications running on a single machine? If so, > ... > Of course, if you need to check applications across a network, then > using TCP/IP is best, The applications are scattered across a network, with a centralized alarming system. > although I would suggest not closing the port at all. Leave it open, > and have the alarming application send a request over the connection. > The server can then report back whether an alarm exists, and better > can also report what the details of the alarm actually are. I agree that would be a better design, but at this point it's going against the inertia of wanting to set up the alarming for this application the same way that several prior applications were set up. Also, the alarming application itself is now in the control of a different department who monitors our platforms for us. It's easier to ask them to add a new address and port to the list of platforms they check than to coordinate a new protocol between our machine and theirs.
Technical Details
Message-ID:
<44f5c67a$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<44f480ff@newsgroups.borland.com> <44f49d01$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,c51ec25c5d4e68e1 X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Lesley Anne" <mspfila-ng@yahoo.com> Newsgroups: borland.public.cppbuilder.internet.socket References: <44f480ff@newsgroups.borland.com> <44f49d01$1@newsgroups.borland.com> Subject: Re: Would Indy's TIdTCPServer have any problem with connections I never read from? Date: Wed, 30 Aug 2006 13:10:12 -0400 Lines: 47 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2869 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 144.160.5.25 Message-ID: <44f5c67a$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1156957818 144.160.5.25 (30 Aug 2006 10:10:18 -0700) Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail