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

Refactor connection handling and add support for WebSocket #112

Closed
wants to merge 1 commit into from

Conversation

dariowskii
Copy link

Fixes #111

This commit refactors the connection handling in the mqtt_connection_base.dart file. It introduces support for WebSocket connections by importing the dart:io library. The _disconnect() method has been modified to close the client properly based on its type. If the client is a WebSocket, it is closed using the close() method. If it is a Socket, it is destroyed using the destroy() method. For other types of clients, the destroy() method is called. This change improves the overall connection handling in the MQTT client.

@shamblett shamblett changed the base branch from master to issue111 September 16, 2024 09:26
@shamblett
Copy link
Owner

You can't pull dart.io(or dart.html) into mqtt5_client, this has to be platform neutral. These libs are pulled into the specialized browser/server clients which extend MqttClient.

The mqtt_client package already has a solution to this issue, I just need to reflect it here.

@dariowskii
Copy link
Author

You can't pull dart.io(or dart.html) into mqtt5_client, this has to be platform neutral. These libs are pulled into the specialized browser/server clients which extend MqttClient.

The mqtt_client package already has a solution to this issue, I just need to reflect it here.

Seems reasonable, I will wait for your solution. If you think it is better to close the PR do as you think best!

@shamblett
Copy link
Owner

OK will do.

@shamblett shamblett closed this Sep 17, 2024
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 this pull request may close these issues.

NoSuchMethodError: method not found
2 participants