Skip to content

IPC not working between .net7 and .net461 #1080

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ahmeteminsahingoz opened this issue Nov 6, 2023 · 9 comments · Fixed by #1122
Closed

IPC not working between .net7 and .net461 #1080

ahmeteminsahingoz opened this issue Nov 6, 2023 · 9 comments · Fixed by #1122

Comments

@ahmeteminsahingoz
Copy link

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
Copy link
Author

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.

@EDouglas-Alamo
Copy link

Hi Ahmeteminsahingoz, just had the same problem, ipc - went from 4.8 to 8; I understand the issue as you've explained, but what was your ultimate solution?

@ahmeteminsahingoz
Copy link
Author

ahmeteminsahingoz commented Dec 6, 2024 via email

@EDouglas-Alamo
Copy link

EDouglas-Alamo commented Dec 6, 2024 via email

@EDouglas-Alamo
Copy link

EDouglas-Alamo commented Dec 6, 2024 via email

@ahmeteminsahingoz
Copy link
Author

ahmeteminsahingoz commented Dec 7, 2024 via email

@ahmeteminsahingoz
Copy link
Author

ahmeteminsahingoz commented Dec 7, 2024 via email

@EDouglas-Alamo
Copy link

EDouglas-Alamo commented Dec 10, 2024 via email

billchungiii pushed a commit to billchungiii/netmq that referenced this issue May 1, 2025
… with hash value calculation using the MurmurHash algorithm.
drewnoakes added a commit to drewnoakes/netmq that referenced this issue May 12, 2025
Fixes zeromq#1080

The previous code used String.GetHashCode, however in .NET 5 and later
this value is not stable across process runs. The value intentionally
varies due to "hash randomization", a security feature.

In this case, we need a stable value, and we need the same value
irrespective of the version of .NET or the platform.

To ensure compatibility, we take the algorithm from .NET Framework.
@drewnoakes
Copy link
Member

Fixed in 4.0.1.15.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants