zeromq / netmq

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

IPC not working between .net7 and .net461 #1080

Open ahmeteminsahingoz opened 1 year ago

ahmeteminsahingoz commented 1 year ago

Environment

NetMQ Version:    4.0.0.1
Operating System: Windows
.NET Version:     .NET7 & .NET461

Expected behaviour

Only difference between working and not working instances is that framework version is changed from net461 to .NET7

Actual behaviour

I upgraded one of my project into .NET7 from net461 and when im trying to send tcp message to net461 applications it works fine, however for IPC communication my messages are not received by net461 application. I tried to upgrade receiving side application to .NET7 as well but problem remains. I checked the encoding differences but there seems no problem since default is set in netmq library, not from .net sources. What might be the possible reason for this problem, I will be glad if you give me some clues

Steps to reproduce the behaviour

Sending message to net461 console application from .NET7 console application using IPC channel.

ahmeteminsahingoz commented 1 year ago

I found the reason behind. NetMQ>Core>Transports>Ipc>IpcAddress.cs

Resolve function which converts pipeName into port number, uses string.GetHashCode() function which is supposed to return same number every time you run it. However at .NET7 property "HashHelpers.s_UseRandomizedStringHashing" is set to true and string.GetHashCode() function returns a random number which causes port number to be wrong.