Skip to content
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

Support Unix Domain Sockets #1908

Closed
rafael-biz opened this issue Jan 9, 2024 · 4 comments · Fixed by #1919
Closed

Support Unix Domain Sockets #1908

rafael-biz opened this issue Jan 9, 2024 · 4 comments · Fixed by #1919
Labels
feature-request New feature or request

Comments

@rafael-biz
Copy link

rafael-biz commented Jan 9, 2024

Describe the feature request

I'm am trying to connect a client application to a MQTT message broker (Mosquitto) through Unix Domain Sockets instead of the localhost loopback address (both are installed on the same machine). However, I'm using the MqttClient and its current implementation doesn't seem to support it.

Which project is your feature request related to?

  • Client

Describe the solution you'd like

I would like the ability to specify the unix file name as a parameter at the MqttClientOptionsBuilder.

Example

    MqttClientOptions clientOptions = new MqttClientOptionsBuilder()
        .WithUnixDomainSocket("foo.socket")
        .Build();
@rafael-biz rafael-biz added the feature-request New feature or request label Jan 9, 2024
@chkr1011
Copy link
Collaborator

These are not yet support and require a rework of the internal socket handling because it requires usage of different classes, overloads etc. I will have a look on how to implement it.

@chkr1011
Copy link
Collaborator

chkr1011 commented Jan 20, 2024

@rafael-biz Please download the following build from the myget feed: https://www.myget.org/feed/mqttnet/package/nuget/MQTTnet/4.3.3.957

This versions adds a new overload for the client options builder (WithEndPoint). It allows you to pass another end point implementation type like the unis domain sockets.

I am not sure if you also have to change the AddressFamily in the options but it may be required.

Please test the version and let me know if it works.

@rafael-biz
Copy link
Author

@chkr1011 Unfortunately I can't test it now because I just discovered that Mosquitto's Unix Domain Sockets support on Windows isn't working either.
eclipse-mosquitto/mosquitto#2857

I'll wait for a fix in Mosquitto so I can test MQTTNet.

Thank you very much!

@chkr1011
Copy link
Collaborator

OK, I will then merge the PR because it exposes the EndPoint which allows using other types of endpoints.

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

Successfully merging a pull request may close this issue.

2 participants