#BUGFIX by stefan
authorStefan Vogel <sv@exept.de>
Tue, 24 Apr 2018 09:35:24 +0200
changeset 22697 e840d7085b3e
parent 22696 7b933d672ea3
child 22698 5365cbdd416e
#BUGFIX by stefan class: ExternalStream class added: #openStreams https://expeccoalm.exept.de/D252299 No need to scan all instances of a class to find open connections
ExternalStream.st
--- a/ExternalStream.st	Mon Apr 23 18:56:07 2018 +0200
+++ b/ExternalStream.st	Tue Apr 24 09:35:24 2018 +0200
@@ -1862,6 +1862,31 @@
     ^ StreamNotOpenError
 ! !
 
+!ExternalStream class methodsFor:'accessing'!
+
+openStreams
+    "answer a collection of open Streams having this class"
+
+    |openStreams|
+
+    openStreams := OrderedCollection new.
+    Lobby keysDo:[:eachStream| 
+                    (eachStream isKindOf:self) ifTrue:[
+                        openStreams add:eachStream
+                    ]
+                ].
+
+    ^ openStreams
+
+    "
+        self openStreams
+        Socket openStreams
+        NonPositionableExternalStream openStreams
+    "
+
+    "Created: / 24-04-2018 / 09:23:33 / stefan"
+! !
+
 !ExternalStream class methodsFor:'defaults'!
 
 bufferSizeForBulkFileCopy