[squeak-dev] Resuming a SocketStream after a ConnectionClosed exception?
Göran Krampe
goran at krampe.se
Wed Feb 15 11:50:32 UTC 2017
Hi guys!
On 14/02/17 03:27, tim Rowledge wrote:
> All in all I’m not at all sure that having two forked processes
> working with the same socket stream is the best way to do this but it
> seems to work tolerably for now. Might it be better to have the
> socket reading process at a higher priority? I can’t think of a way
> to merge the two, which might be a better technique.
I wrote the current incarnation of SocketStream and I intentionally did
not add any semaphore/mutex for protections. And yes, the SocketStream
has internal state to know positions in buffers etc etc - so NO, you
should not use two Processes with the same SocketStream.
Having said that... if you have one process only writing and one only
reading - you may get away with it - IIRC (no promises) the inBuffer and
outBuffer (and associated ivars) may be 100% separated.
regards, Göran
More information about the Squeak-dev
mailing list
|