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
Connection lost (32109) - EOFException after connect for Websocket connection #679
Comments
Here is the simplest repro of the issue that I could make: String broker = "wss://iot.eclipse.org:443";
String clientId = "JavaSample";
MemoryPersistence persistence = new MemoryPersistence();
try {
MqttClient sampleClient = new MqttClient(broker, clientId, persistence);
sampleClient.setCallback(new MqttCallback()
{
@Override
public void connectionLost(Throwable cause) {
System.out.println("Lost connection");
cause.printStackTrace(); //EOFException thrown here within a few seconds
}
@Override
public void messageArrived(String topic, MqttMessage message) throws Exception {
}
@Override
public void deliveryComplete(IMqttDeliveryToken token) {
}
});
System.out.println("Connecting to broker: "+broker);
sampleClient.connect();
System.out.println("Connected");
} catch(MqttException me) {
me.printStackTrace();
}
while (true)
{
//Just wait for connectionLost callback to happen
} |
I have seen this bug as well. FWIW, reverting to 1.2.0 seems to fix the bug. |
same here! |
same. any solutions? |
…e is 1000 that bring connection issue described in issue eclipse#679 Signed-off-by: siavash.solimaniii <siavash.solimanii@yahoo.com>
the issue seems because of the read time out of socket. you can set the soTimeout property in ConnectOptions to 0 for infinite read timeout or you can set a value based on your system requirements. |
Same problem here. |
@icraggs this is a big blocker for me, is any work being done to fix this issue? And are there any plans to put out a new release with that fix? |
Yes, I'm starting to look at it now. I've been making a new release of the C client as well as MQTT V5 support. I think this will need some new tests. |
Thanks for getting the fix into the dev branch, @icraggs ! When can I expect a release with this fix? |
@icraggs pinging on this, I would really appreciate an ETA on the release of this fix |
@timtay-microsoft if you're in a hurry your best bet is to pull the develop branch and build the .jar file yourself, until version 1.2.2 is released. |
I'll look into getting out a release next week. |
1.2.2 release created |
Thanks, icraggs! |
Updated to Paho 1.2.2 and increased sleep time to allow for Paho TCPNetworkModule to register the SO Timeout. Underlying issue resolved by eclipse/paho.mqtt.java#679. Closes #2.
Still getting EOF exception on v1.2.2:
|
@ishaansrm Could you please open a new issue with details of your use/test case and any detail you can provide to help with debugging the issue. |
Sorry false alarm, the issue was due to some other issues not related to the lib |
@ishaansrm what was your error from? i am having the same issue and maybe it is something similar |
Well, my mqtt was accidentally pointing to a staging broker, which was offline. You might want to check the broker endpoint & then see if the broker is up & running & what data that's receiving. |
@ishaansrm do you have an example for this loop, "check the broker endpoint & then see if the broker is up & running & what data that's receiving"? |
My problem is that i have a broker that works all day, and at night it is getting closed. In the morning when it gets started, my android app tries to reconnect to it with success. But after this every keepAlive * 1.5 seconds the android app gets "lost connection" and reconnects to the broker after 1-2 seconds. I think this issue disappear after I interact with the android tablet.
|
I am using |
@gitusman were you able to solve this by anymeans |
Please fill out the form below before submitting, thank you!
Upgrading from version 1.2.0 to 1.2.1 appears to introduce a regression on issue #358
Connection appears to be established successfully, but connection is lost shortly afterwards with a stacktrace like
The issue repro's consistently, and affects any WSS connections that I try.
server uri looks like: "wss://mywebsite.net/$iothub/websocket" and the mqtt connection options are all the default values.
The text was updated successfully, but these errors were encountered: