zeromq / netmq

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

SendFrame never sends, never returns. #1107

Closed Logopher closed 3 weeks ago

Logopher commented 3 weeks ago

Environment

NetMQ Version:    4.0.1.13
Operating System: Windows 10 IoT Enterprise LTSC
.NET Version:     .Net 6.0 (for now)

Expected behaviour

The server/driver should receive the message frame, and then SendFrame should return.

Actual behaviour

The thread calling SendFrame is arrested, the driver never hears the message.

Steps to reproduce the behaviour

My attempt to produce a minimal test case has failed. I doubt this is in fact a bug in NetMQ. The following content was written for other communities.

I'm attempting to upgrade a .Net Framework 4.0 project to .Net Core. (The previous, working version of the project uses clrzmq.) So far I've managed to get it all working properly except the ZeroMQ aspect.

The product consists of a C# WPF application and a C++ (Windows) console application (driver). For now, I am only upgrading the WPF application to .Net Core; the driver may follow later.

My problem is that the WPF app is supposed to contact the driver. The connection is apparently set up properly but then when I attempt to send a message the SendFrame method never returns and the driver never receives the message. I also haven't managed to find the message in Wireshark, but I'm a novice with that tool.

I have produced a minimal test case which does not fail in the way that the WPF application does. That test case consists of a client and server both written in C# with NetMQ.

I don't have any ideas left for why this might be happening. I guess my next thing to try is to build the minimal server in C++. Help, please?

Logopher commented 3 weeks ago

When I run the minimal client code from the WPF app (on its own thread), the minimal server hears the message. I then targeted the driver with a valid message copied from the failing code, and the driver received the message.

Logopher commented 3 weeks ago

I was moving a socket across threads. Never mind.