[squeak-dev] What is the contract of SocketStream>>#next:?

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Tue Oct 7 20:42:52 UTC 2014


Since (String new readStream next: 4) answers an empty string, so at least
this seem consistent with the rest...
Some dialects have something like nextAvailable: 4 for this behavior and
let next: 4 raise an exception, but not Squeak.

2014-10-07 21:41 GMT+02:00 Chris Muller <asqueaker at gmail.com>:

> Assuming its 'shouldSignal' is true, if I say:
>
>   mySocketStream next: 4
>
> shouldn't I be guaranteed either 4 bytes of data, or an exception
> (Timeout or ConnectionClosed)?  But, never less than 4 bytes of data,
> right?
>
> Over the last few weeks I have been running very heavy networking and
> noticed several times "SocketStream>>#next: 4" returning me either an
> empty Array or nil.  I've seen it more than once but can't reproduce
> it.
>
> Wouldn't that have to be a bug?
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20141007/3a355496/attachment.htm


More information about the Squeak-dev mailing list