-
Notifications
You must be signed in to change notification settings - Fork 453
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
read failed, socket might closed or timeout, read ret: -1 #154
Comments
Hi @HajerWael. Were you able to solve this error? |
Same here, in my case i'm tying to connect to an Intel NUC. |
Hi @martesabt. What's the occurance rate of this error for you? Is it random or you are stuck with it? |
Hey @vaibhiarora03, unfortunately I'm stuck with it. I also tried to connect the device to the Intel NUC through BT system settings, and it worked. Then when I request BT devices with the package the Intel NUC has the status connected. |
Hi @martesabt . I did some searching for this issue and had implemented it from those learnings. You can have a look at my implementation. Though the code I tried didn't work for me but worked for many others. Maybe it can help you out. |
Thanks @vaibhiarora03 I will take a look at it. I noticed you closed #160 did you found an alternative? This is frustrating :( |
@martesabt The logs which i mentioned in the post had my custom logs in it making it useless to point to the exact issue. Thats why closed it and opened a new issue with proper information. |
@vaibhiarora03 Oh, ok! I hope we can solve this! |
hello Everyone You can change BluetoothConnection.java class /// Connects to given device by hardware address (default UUID used) |
this saved me, thx man |
@RRohitM I tried this method, but it caused my code to compile to my device. Were there any other changes that you made to the base example codes? |
I tried @RRohitM solution but still same issue |
This should help. https://stackoverflow.com/a/25647197/5552022 So change from device.createRfcommSocketToServiceRecord(uuid); // or device.createInsecureRfcommSocketToServiceRecord(uuid); to socket = (BluetoothSocket) device.getClass().getMethod("createRfcommSocket", new Class[] {int.class}).invoke(device, 1); |
Saved my life man! |
Tried to use the package to add chat feature ,always getting this error when try to connect to a paired device (android mobile) as below .
read failed, socket might closed or timeout, read ret: -1
What I tried:
I'm stucked at this point ,really need to implement this feature asap , soo any help ??
Thanks in advanced,
The text was updated successfully, but these errors were encountered: