Hello guys, today, by examining closely the #atEnd implementation , i came to conclision that is can be made as simple as:
atEnd ^ self isDataAvailable not Because, take a close look at old implementation: atEnd self isInBufferEmpty ifFalse: [^false]. ----***--- ^self isConnected not and: [self isDataAvailable not] and: isDataAvailable self isInBufferEmpty ifFalse: [^true]. ---***--- ^socket dataAvailable ifFalse: [false] ifTrue: [self receiveDataIfAvailable; isDataAvailable] a Socket>>dataAvailable answers false on closed or invalid socket. You can check it quite simply: (SocketStream openConnectionToHostNamed: 'google.com' port: 80) socket closeAndDestroy dataAvailable (SocketStream openConnectionToHostNamed: 'google.com' port: 80) close socket dataAvailable Socket new dataAvailable => all 3 answer false Therefore, a complex logic in #atEnd, could be simplified. Please, try to find a flaw in my conclusions. I think there's not. But 2 (or more) heads always better than 1. -- Best regards, Igor Stasenko AKA sig. _______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project