shamblett / mqtt_client

A server and browser based MQTT client for dart
Other
548 stars 176 forks source link

How do I know if I am in conflict with another account #82

Closed shingohu closed 5 years ago

shingohu commented 5 years ago

in java,when the connectLost callback and the exception is EOFException ,we know another account online

another question, the same code the library version is v5.5.0 in android immediately received a onDisconnected callback when I disconnected the network but in ios the onDisconnected callback don't call or after a long time the callback will execute

shamblett commented 5 years ago

Not sure what you mean by 'in java...', the client doesn't know anything about 'other accounts', its just an MQTT client, the onDisconnect callback is wired to the onDone socket callback so is triggered when the socket closes(or when the underlying OS decides to tell you this) so it looks as though on IOS onDone is not being called when you expect it to be, this is really a question for the Google flutter devs, in the Drat VM the client works as expected.

shingohu commented 5 years ago

I'm sorry, there's something wrong with my description,I've used this client before https://github.com/eclipse/paho.mqtt.java,when the same account connect,will receive an EOFException

shamblett commented 5 years ago

Yes, thsi is a Java exception raised by the Java runtime, there's no equivalent in Dart, you just get onDone.