Skip to content
Success

Changes

Summary

  1. Reapply "Release all waiting processes when destroying a socket (fixes #15975)" (details)
  2. Signal each Semaphore only once to avoid dependency on #signalAll (details)
  3. Access semaphores directly from their instance variables rather than through accessors (details)
  4. Add delay and update comment in #testFlushOtherEndClosed to prevent transient failure (details)
  5. Add wait in #testNextPutAllFlushOtherEndClosed similar to #testFlushOtherEndClosed (details)
  6. Ensure we actually fill the TCP send buffer in #testFlushLargeMessageOtherEndClosed (details)
  7. Skip SocketStreamTest>>testFlushLargeMessageOtherEndClosed on Windows (details)
  8. Clarify the purpose of the return value from #waitForSendDoneFor:... (details)
Commit 36dd6e1fc53f6a8ef1f6499f4df26ec32b9b56e0 by daniels220
Reapply "Release all waiting processes when destroying a socket (fixes #15975)"

This reverts commit f5df5966bd73d05bc04806d2f8735baa4b1783cb.
The file was modified src/Network-Kernel/Socket.class.st (diff)
Commit c6a90bb733ac8879efaedc58092f5cd5aa0b7120 by daniels220
Signal each Semaphore only once to avoid dependency on #signalAll

This should be sufficient, as multiple processes trying to read or write at once will result in undefined behavior anyway as their data gets all mixed up together.

The file was modified src/Network-Kernel/Socket.class.st (diff)
Commit 2088327666c2f1da1a3a92f7ddbf507c010bc499 by daniels220
Access semaphores directly from their instance variables rather than through accessors

This was already sometimes the case, and makes sense--these are private implementation details that really shouldn't be exposed to the outside world at all.
Also refactor to make it clearer that #waitForData is strictly a degenerate case of #waitForDataFor:...--the loop structure is identical, just without the timeout-related bits.
The file was modified src/Network-Kernel/Socket.class.st (diff)
Commit 05bc3b03ddd0d815ab0de17df60eab08dd6f747e by daniels220
Add delay and update comment in #testFlushOtherEndClosed to prevent transient failure
The file was modified src/Network-Tests/SocketStreamTest.class.st (diff)
Commit 838b22195138504d7e8086d90c143252ba3f6d29 by daniels220
Add wait in #testNextPutAllFlushOtherEndClosed similar to #testFlushOtherEndClosed

Actually, extract a helper as the first part of each test is identical.
The file was modified src/Network-Tests/SocketStreamTest.class.st (diff)
Commit ea9c18beaebd7f57d795f18a67b810d303418024 by daniels220
Ensure we actually fill the TCP send buffer in #testFlushLargeMessageOtherEndClosed

Linux default is enormous (~2.5MiB), while Windows is only 65KiB. Attempt to standardize on this small buffer, but make sure we exceed the *actual* buffer size, as Linux (again) refuses to set a buffer size below 416KiB.
The file was modified src/Network-Tests/SocketStreamTest.class.st (diff)
Commit 9dba525394218682a9be006de37d5869568ab705 by daniels220
Skip SocketStreamTest>>testFlushLargeMessageOtherEndClosed on Windows

Fails due to Windows accepting arbitrarily large messages--much larger than the TCP send buffer--in a single send(2) call, preventing #waitForSendDone... from being called during the send process. Not sure why but this is not a regression, just strange behavior revealed by the new test.
The file was modified src/Network-Tests/SocketStreamTest.class.st (diff)
Commit 82d4d7bb02a96f2d1ea94672f84e132e82a9656e by daniels220
Clarify the purpose of the return value from #waitForSendDoneFor:...

Also, no need to actually store a `sendDone` temp, if we reach the end of the method we know it is true.
The file was modified src/Network-Kernel/Socket.class.st (diff)