So for the given example....
| webSocket |
[ webSocket
�� ��sendMessage: 'Pharo Smalltalk using Zinc WebSockets !';
�� ��readMessage ] ensure: [ webSocket close ].
re-implementing as follows seems to work...
[ webSocket runWith: [ :msg | Transcript crShow: msg ] ] forkAt: 35.
webSocket sendMessage: 'Pharo Smalltalk using Zinc WebSockets !'.
webSocket sendMessage: 'Another multi-thread echo'.
webSocket close
but that could just be by luck, so I ask.
btw, if I don't send the #close in the last line, after ~30 seconds I get an error
�� ����ConnectionClosed: Cannot write data
which seems reasonable that the other end timed out and closed the connection,
but when I send the #close, after ~30 seconds I get an error...
�� ��PrimitiveFailed: primitive #primSocketReceiveDataAvailable: in Socket failed
which is unfriendly.�� What is the best way to neatly stop trying to receive data when we explicitly close the websocket?
cheers -ben
P.S.�� I wonder if when a ZnWebSocket is closed, it might be worthwhile
to do�� "role:=#closed"�� to provide some visibility of its state in its GTInspector [Raw] tab..