Stability opf Squeak on Linux

Rob Withers slosher2 at home.com
Wed Nov 15 01:39:37 UTC 2000


John M McIntosh wrote:
> 
> >
> >Great idea, but let's be careful.  In ThisEndClosed, you should be able
> >to read but not write.  In OtherEndClosed, you should be able to write
> >but not read.  Right?
> >
> 
> I should point out that right now on the mac you can be in the state
> otherEndClosed but still have pending data to be read from the socket.
>
> We should decide if this is valid? Technically I could get a read
> event, where we read the data into an internal buffer, then signal
> the read semaphore, then the otherEndClosed event comes in. Thus we
> now have the socket in otherEndClosed state but data still pending to
> be read.

I do this too by keeping 2 states, the os descriptor state and the
squeak socket state.  At that point in time I have (TCPOtherEndClosed,
Connected, data in buffer).  When the last data is read from the buffer,
I transition the squeak state to OtherEndClosed.  I am fluxuating
between whether it is still writable in this state.  If the other end,
whatever the environment, does a shutdown(SHUT_WR), then we should still
be writable on this end.

This happens with any http request where the socket is closed by the
server after sending its data.

> Much of the code I've seen assumes if the socket is connected then do
> what ever, if the socket goes out of connected state, then do the
> termination, which misses the otherEndClosed state.

I see it too.  It goes from [self isConnected] whileTrue: [...read...] 
to self close.  But the underlying socket does go through
OtherEndClosed.

> Also note if we are in ThisEndClosed state and we get a
> otherEndClosed I disconnect the socket (state goes to Unconnected)
> (which seems reasonable to me at the time).

absolutely, although I do a close to finish the job.

John, could you explain the situation around what the return is when you
primRead from an otherEndClosed socket (and the buffers are empty).  How
about primWriting to a thisEndClosed socket?  Previously they were
returning 0 (bytesRead/Wrote), I believe.  Are we expecting exceptions
now?

Rob

> --
> --
> ===========================================================================
> 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
> ===========================================================================

-- 
--------------------------------------------------
Smalltalking by choice.  Isn't it nice to have one!





More information about the Squeak-dev mailing list