zeromq / netmq

A 100% native C# implementation of ZeroMQ for .NET
Other
2.95k stars 744 forks source link

NetMQConfig.Cleanup() hangs forever even after dispose #1040

Open Sahasrara opened 1 year ago

Sahasrara commented 1 year ago

Environment

NetMQ Version:   4.0.1.10
Operating System: macOS 12.6
.NET Version: Unity 2022.1.21f1

Expected behaviour

I would expect the program not to block forever.

Actual behaviour

The program blocks forever.

Steps to reproduce the behaviour

    public static void ZeroMQ()
    {
        try
        {
            TimeSpan timeout = TimeSpan.FromMilliseconds(2000);
            AsyncIO.ForceDotNet.Force();
            using (PairSocket client = new PairSocket("tcp://127.0.0.1:5555"))
            {
                            client.Options.Linger = TimeSpan.Zero;
                bool success = client.TrySendFrame(timeout, "Hello");
                Debug.Log($"Success = {success}");
                string msg = string.Empty;
                success = client.TryReceiveFrameString(timeout, out msg);
                Debug.Log($"Success = {success} - {msg}");
                success = client.TryReceiveFrameString(timeout, out msg);
                Debug.Log($"Success = {success} - {msg}");
            }
        }
        catch (Exception e)
        {
            Debug.Log(e);
        }
        finally
        {
            NetMQConfig.Cleanup();
        }
    }
follesoe commented 1 year ago

Experiencing the same issue on macOS and Xamarin.

waterpare833 commented 3 months ago

I'm currently experiencing the same issue on macOS.

Archtica commented 2 months ago

I have the same issue on NetMQ 4.0.1.13 - macOS. Everything is fine on Windows. Unity 2022.3.38f