Login  
Search All Forums
Dart Home | PowerTCP Sockets for .NET | Custom Development Reply | PowerTCP Sockets for .NET (Secure and Standard) Topics | Forums   
AuthorForum: PowerTCP Sockets for .NET (Secure and Standard)
Topic: Connection Closed Notification
drfonz

From: London, United Kingdom
Posts: 6
Member Since: 01/14/05
posted February 2, 2005 7:39 AM

Hi,

I have a collection of Server objects monitoring different ports, each one potentially controlling multiple connections. What I want to do is to get a particular server to stop listening once all its connections have been closed.

There are no events in the Server component that account for this, and the Tcp ConnectedChanged event is not usable because even though we know a connection has closed, we don't know which server it belonged to before it died.

I could Tag each connection with a reference to its parent, but I'm already using the Tag property for something else and I rather not introduce circular references in my code if possible.

So, does anybody have any suggestions as to how to achieve this?

Thanks!
AL
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted February 2, 2005 8:21 AM

The Tag is your only option. That is what it's for. Instead of using the Tag to hold a single value, set it to an array or a class that holds many.
drfonz

From: London, United Kingdom
Posts: 6
Member Since: 01/14/05
posted February 2, 2005 8:24 AM

Yeah, while I was waiting for a reply I came to the same conclusion, so it is now implemented and working like a charm.

Thanks!
AL
Reply | PowerTCP Sockets for .NET (Secure and Standard) Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX