sockets in threads

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

sockets in threads

Aidan Gauland
Hello,

  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
Workspace)...

[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
socket.

I can't figure out what the problem is.  Any ideas, anyone?

Thanks,
Aidan

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners