Skip to content

reconnectBlocking blocks the callback all the time #1456

Open

Description

@Adiudiu

Describe the bug
JWebSocketClient reconnectBlocking

To Reproduce
Steps to reproduce the behavior:
No network is always reconnected in a single thread

Expected behavior
A clear and concise description of what you expected to happen.

Debug log

Environment(please complete the following information):

  • Version used: 1.5.7
  • Java version: 1.8
  • Operating System and version: Android Redmi 14
  • Endpoint Name and version:
  • Link to your project:

Additional context

Activity

  1. PhilipRoman commented on Feb 12, 2025

    @PhilipRoman
    Collaborator

    Are you calling reconnectBlocking from the onClose callback? This will not work, since you shouldn't do blocking tasks from callbacks. Try using a separate thread instead.

  2. Adiudiu commented on Feb 13, 2025

    @Adiudiu
    Author

    Are you calling reconnectBlocking from the onClose callback? This will not work, since you shouldn't do blocking tasks from callbacks. Try using a separate thread instead.

    I enable a single-thread call reconnectBlocking in the onClose callback, and then the whole thread is blocked. It is recommended to add a timeout setting in the WebSocketClient#reconnectBlocking method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions