-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Unable to connect with Unix Socket #1989
Comments
I cannot this test on my own because I have no Unix socket server. I searched for some examples and in those examples, they set the protocol type to IP instead of TCP. Could you please try version 4.3.4.1071 from the MyGet feed (https://www.myget.org/feed/mqttnet/package/nuget/MQTTnet) and let me know if changing the protocol type (to IP) fixes the issue? |
I try to set protocol type to "IP" with the build 4.3.4.1071.
I don't have the same error but there is another one on the NoDelay property:
I searched more information about SocketOptionLevel, and it seems that it is not possible to set SocketOptionLevel.TCP or IP to an unix socket: https://learn.microsoft.com/en-us/dotnet/api/system.net.sockets.socketoptionlevel?view=net-8.0 Update: I rebuild the library on my own, and I commented 'set' method for NoDelay property in the file 'CrossPlatformSocket.cs':
I know it is not a final solution, but it is only for testing. Then, I set 'protocolType' to 'Unspecified' like that:
With this change, it works ! |
Thanks for testing and providing feedback. Please try again with version x.x.x.1073 from the myget feed. The NoDelay is only set if the protocol type supports that algorithm at all. It if works I can create a PR, merge and release a new version. |
I tried with the build x.x.x.1073 and it works ! |
Describe the bug
MqttClient is not able to connect to a mosquitto broker using unix sockets.
Which component is your bug related to?
To Reproduce
Steps to reproduce the behavior:
This error is returned:
Expected behavior
A previous issue was be implemented but not tested: #1908
I think, there is an error when the library tries to initiate socket object.
In the file: "CrossPlaformSocket.cs", the constructor create Socket with the protocolType = TCP:
Maybe, ProtocolType shall not be equal to TCP in case of Unix socket ?
Can I specify the protocol type by another way ?
The text was updated successfully, but these errors were encountered: