question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hello!

MQTTnet under mono seems to have an issue with an environment that lacks IPv6 - for instance, by passing ipv6.disable=1 as kernel parameter.

First, when starting an MQTTnet server, the server will not start unless BoundInterNetworkV6Address is explicitly set to IPAddress.None when building the MQTT server options with MqttServerOptions. This workaround suffices to make MQTTnet listen only on the IPv4 address - otherwise, the server will not start and will fail with the exception error:

An address incompatible with the requested protocol was used

Unfortunately, for the MQTTnet client part, I have not found a workaround and if the OS lacks IPv6 support, then the MQTTnet client will fail to connect with the same error.

I am unsure whether this issue pertains more to mono rather than MQTTnet but could the MQTTnet client implementation expose a way to set the IPv6 endpoint so it can be set to IPAddress.None such that the same workaround could be applied?

Thanks!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
chkr1011commented, Mar 22, 2019

Please try to implement your own channel factory and pass it in the constructor of the MqttClient. There you can return a channel which is NOT depending on a dual mode socket (which might be only supported in .net). Another solution might me moving to .net core instead of mono.

0reactions
chkr1011commented, May 10, 2019

Ah sorry. It is not there. It is in the TCP options. The problem is that these are not exposed to the builder yet. So you have to parse them to TcpOptions after using the builder or create them without the builder. I will fix that for the next version.

Read more comments on GitHub >

github_iconTop Results From Across the Web

IPv6 Support on mono · Issue #835 · Sonarr ...
Specifying the IPv6 address manually does bind to IPv6, but connecting returns only an invalid host message with nothing in the logbook. But, ......
Read more >
Mono IPv4 versus IPv6 issues - Invalid arguments
I have a Mono .NET application that uses ppatierno.AzureSBLite to receive data from an Azure ServiceBus. The code is straightforward:
Read more >
IPv6 Support for Mono based servers - Remoting SDK
I ran into some problems with it whilst testing a .NET command line server and with strace found it was trying IPv6 and...
Read more >
235716 – lang/mono IPv6 support
AF_INET6 is 30 on MacOS but 28 on FreeBSD. This allows mono to connect to IPv6 only hostnames: csharp -e 'new System.Net.WebClient ()....
Read more >
IPV6 support for web server and download clients?
Issue : IPv6 Support on mono ... Looks like IPv6 works on Windows, but doesn't on OS X (and possibly other systems running...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found