Skip to content

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

Open
@Sahasrara

Description

@Sahasrara

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();
	    }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions