Unix VM still coughing sockets...
Lex Spoon
lex at cc.gatech.edu
Wed May 22 15:10:21 UTC 2002
John M McIntosh <johnmci at smalltalkconsulting.com> wrote:
> At 11:21 PM +0200 5/21/02, Ian Piumarta wrote:
> >If the above still doesn't work then I think we're going to have to
> >"get violent" and make primSockStatus check explicitly for remote
> >close (which would immediately answer "false" to isConnected at [5]
> >and in the controlling expression of the waitForDataUntil loop) even
> >though (i) it implies a (nontrivial!) syscall at every status check,
> >(ii) it creates a race in waitForDataUntil, and (iii) the detection
> >can be done just as well elsewhere, assuming the image behaves
> >sensibly (which is maybe not such an intelligent assumption after
> >all).
> >
> >Regards,
> >Ian
>
> Ian I think on the mac (mmm I should know this heh?) returns
> OtherEndClosed via self primSocketConnectionStatus: socketHandle when
> the socket is closed by the other side, thus falling thru the
> [sock isConnected | sock dataAvailable] whileTrue: [...] [5] check
>
> The state goes to Closed once we initiate the close on our side.
Right. And similarly, there is ThisEndClosed for if we have done
#close, but the other end hasn't noticed yet. In state ThisEndClosed,
you can still receive data. In state OtherEndClosed, you can still send
data. This has confused some Squeak-level code in the past, which might
say, for example, "#isConnected is false? then no data can be
available".
-Lex
More information about the Squeak-dev
mailing list
|