Stability opf Squeak on Linux
John M McIntosh
johnmci at smalltalkconsulting.com
Wed Nov 15 20:02:34 UTC 2000
>
>I did have it this way, originally, but one of the Flow tests didn't
>like it so I changed it to closing both the read and write channels. As
>John mentions, most code checks isConnected.
>
>Squeak State
>Unconnected read data: no write data: no
>WaitingForConnection read data: no write data: no
>Established read data: yes write data: yes
>ThisEndClosed read data: yes write data: no
>OtherEndClosed read data: no write data: yes ???
>
>If we have agreement on this, and decide what close means (shutdown
>write only?), and determine that a read or write primitive fails
>(exception signalled), when attempted in the wrong state, then we will
>have just about licked this thing.
On the mac if the otherEndClosed and we attempt a write I *think*
we'll end up with a primitive failure. What really happens here is I
just invoke the socket write (OTSnd) and if it fails and the failure
case isn't one I've got a valid handler for (flow control for
example) then we invoke a primitive falure.
The reason for this is that because the socket state is run at the
interrupt level I can't check a flag to see if the socket is still
valid to write to because it's no guarantee that the socket will be
writable at the point when I want to do the write (a race condition
issue), thus I just let the write fail.
Re close from the Squeak code
close
"Close this connection gracefully. For TCP, this sends a
close request, but the stream remains open until the other side also
closes it."
self primSocketCloseConnection: socketHandle. "close this end"
re read or write primitive
Fail if write to a non-writable socket seems the current case.
read? Right now it seems reads are allowed as long as the socket is
valid, it returns either data or zero. This seems in keeping with the
current Smalltalk code. But what happens if the socket is invalid?
On the mac it return -1 as the size, which then has interesting
implications for the code since much of the Smalltalk code takes that
-1 as a length and attempts to do things with it which usually
results in failure. Iterations from 1 to -1 by 1 or new: -1 etc... I
have a feeling this should really cause a primitive failure.
--
--
===========================================================================
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com
===========================================================================
Custom Macintosh programming & various Smalltalk dialects
PGP Key: DSS/Diff/46FC3BE6
Fingerprint=B22F 7D67 92B7 5D52 72D7 E94A EE69 2D21 46FC 3BE6
===========================================================================
More information about the Squeak-dev
mailing list
|