Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions src/NetMQ/Core/Utils/Poller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ You should have received a copy of the GNU Lesser General Public License
using System.Collections.Generic;
using System.Linq;
using System.Net.Sockets;
#if !NETFRAMEWORK
using System.Runtime.InteropServices;
#endif
using System.Threading;

namespace NetMQ.Core.Utils
Expand Down Expand Up @@ -281,22 +278,7 @@ private void Loop()
try
{
timeout = timeout != 0 ? timeout * 1000 : -1;
#if NETFRAMEWORK
Socket.Select(readList, null, errorList, timeout);
#else
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
// Socket.Select does not work properly on macOS .NET Core when readList and errorList are passed
// together. To avoid this problem, we call the Select function separately for errorList.
// Please refer to this issue: https://github.com/dotnet/corefx/issues/39617
SocketUtility.Select(readList, null, null, timeout);
SocketUtility.Select(null, null, errorList, timeout);
}
else
{
Socket.Select(readList, null, errorList, timeout);
}
#endif
}
Comment on lines 280 to 282
Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change fixes a macOS-specific hang, but the repo’s CI doesn’t run tests on macOS, and there’s no regression test that would fail if Socket.Select blocks forever in the poll loop. Consider adding a regression test that exercises Cleanup(block: false) under the same conditions as #1040 and asserts it completes within a bounded time (and/or add a macOS CI job so the test actually runs on the affected platform).

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

catch (SocketException)
{
Expand Down
Loading