[squeak-dev] Socket connection signals ought to be handled?

tim Rowledge tim at rowledge.org
Wed Feb 26 23:13:59 UTC 2014


I’m enjoying modernising some ScratchServer code and stumbling across a lot of changes made over the years. Sockets are not something I’m very knowledgable about so this is ‘fun’, for certain unusual definitions of the word.

As part of this ‘fun’ I notice that Socket>connectTo:waitForConnectionFor: (which uses Socket>waitForConnection:ifTimedOut:ifRefused:) may well raise one of two exceptions and that very few places seem to handle them, particularly a number of tests that I tried. 

As an example , SocketStreamTest>setUp sends connectTo:port: which will end up using the standard timeout and may raise an exception; but the test code then explicitly does some wait method (which actually re-runs the very same lower-level code and may raise the same exceptions!) and other stuff. That looks to me like out of date code that will fail oddly with current Socket code. Tests and other examples really ought to be up to date and correct so we can rely upon them to work and to explain how to Do It Right.

As I say, I really don’t know Sockets. If someone loves Sockets and feels like fixing them up, I’d suggest starting by looking at senders of #connectTo:port: and spreading out from there. And maybe you could wave your hand and volunteer to help me out...

tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
M$ are grinning pigs in a sea of buggy code - The Inquirer






More information about the Squeak-dev mailing list