Skip to content

Commit 7c9a97f

Browse files
Copilotdrewnoakes
andauthored
Remove macOS Socket.Select workaround — the dotnet/corefx#39617 bug is fixed in .NET 9+
Agent-Logs-Url: https://github.com/zeromq/netmq/sessions/0798ef7e-5281-4907-afe0-676d68fe60c2 Co-authored-by: drewnoakes <[email protected]>
1 parent 5e77629 commit 7c9a97f

1 file changed

Lines changed: 0 additions & 22 deletions

File tree

src/NetMQ/Core/Utils/Poller.cs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ You should have received a copy of the GNU Lesser General Public License
2323
using System.Collections.Generic;
2424
using System.Linq;
2525
using System.Net.Sockets;
26-
#if !NETFRAMEWORK
27-
using System.Runtime.InteropServices;
28-
#endif
2926
using System.Threading;
3027

3128
namespace NetMQ.Core.Utils
@@ -281,26 +278,7 @@ private void Loop()
281278
try
282279
{
283280
timeout = timeout != 0 ? timeout * 1000 : -1;
284-
#if NETFRAMEWORK
285281
Socket.Select(readList, null, errorList, timeout);
286-
#else
287-
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
288-
{
289-
// Socket.Select does not work properly on macOS .NET Core when readList and errorList are passed
290-
// together. To avoid this problem, we call the Select function separately for errorList.
291-
// Please refer to this issue: https://github.com/dotnet/corefx/issues/39617
292-
SocketUtility.Select(readList, null, null, timeout);
293-
// If the first select found readable sockets, use a non-blocking (0) timeout for the
294-
// error check so we don't block indefinitely on a stale list before processing InEvent.
295-
// Events queued by the first select (e.g. a ForceStop command) are not yet processed
296-
// because InEvent runs after both selects, so a second infinite-wait here would deadlock.
297-
SocketUtility.Select(null, null, errorList, readList.Count > 0 ? 0 : timeout);
298-
}
299-
else
300-
{
301-
Socket.Select(readList, null, errorList, timeout);
302-
}
303-
#endif
304282
}
305283
catch (SocketException)
306284
{

0 commit comments

Comments
 (0)