[Newbies] sockets in threads
wgsilkie at ihug.co.nz
Sat Sep 27 04:14:06 UTC 2008
I have successfully followed this tutorial on the Squeak wiki,
http://wiki.squeak.org/squeak/325 so I tried to come up with a way to have a
socket listening on its own thread. This is what I came up with (in a
[sckt := Socket newTCP listenOn: 8080.
[sckt isConnected & sckt dataAvailable
ifTrue: [Transcript cr; show: (sckt receiveData)].
(Delay forSeconds: 1.5) wait] repeat] fork.
But when I open an inspector on a new socket, and use it to connect to the
socket on the thread, it doesn't work. Here's what happens...
-The socket used to connect says it's connected.
-sckt says something like "other end closed, but not this end".
-And nothing shows up on the Transcript when I sendData: on the connecting
I can't figure out what the problem is. Any ideas, anyone?
More information about the Beginners