Mantis - Squeak
Viewing Issue Advanced Details
1397 Network minor always 06-29-05 18:02 06-29-05 18:03
lexspoon  
 
normal  
new 3.8  
open  
none    
none  
0001397: [BUG] waitForData and half-closed connections
There is an ancient bug in the method
waitForDataFor:ifClosed:ifTimedOut:. The offending statement is this
one:

    self isConnected
        ifFalse: [^closedBlock value].

isConnected only returns true if the socket is fully connected.
However, surely you should be able to wait-for-data if the socket is
half-open for receiving data?

In that case -- which seems correct -- the test should be
isOtherEndConnected. Or at least, I think it should be. I get mixed up
about this, but it seems like "closing" is a promise not to send any
more data. Thus, if you are waiting for data, you want to know that the
other side has not closed the connection.

However, #flush seems to make the opposite assumption: if you want to
send data, then you need isOtherEndConnected. It seems to me that you
want isThisEndConnected.

Or maybe half-closed connections just aren't modeled. But surely they
should be.....

The other waitForData and waitForSendDone variants have the same bug.

There are no notes attached to this issue.