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

Error: IllegalThreadStateException when starting a new connection after closing a previous one in V3 plugin. #8

Closed
michaelgy opened this issue Jun 27, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@michaelgy
Copy link

Hi, currently when you start a new connection after closing a previous one you get:

StartConnection Error: IllegalThreadStateException

Looking into stackoverflow, it seems that the line #154 is the problem:

reader = new BufferedReader(new InputStreamReader(inputStream));
ReadDatathread.start();
UnityPlayer.UnitySendMessage("BluetoothManager", "ConnectionStatus", "connected");

I think that the solution is to create a new thread before running ReadDatathread.start();.

How to reproduce it

  1. Start a connection.
  2. Close the connection.
  3. Start a connection.
@bentalebahmed
Copy link
Owner

I ll test that and get back to you

@bentalebahmed
Copy link
Owner

Problem solved, please check the last update. Let me know if you face any further issues. thanks for your support.

@bentalebahmed bentalebahmed added the bug Something isn't working label Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants