Skip to content

On closing a connection, Websocket is stuck in READYSTATE.CLOSING #677

@kimtuitoek

Description

@kimtuitoek

When trying to check for whether READYSTATE.CLOSED is set by running WebSocketImpl.isClosed(). READYSTATE is always set to CLOSING after initiating a close/closeConnection.

Expected Behavior

READYSTATE should be set to CLOSED regardless of whether the close was normal or abnormal.

Current Behavior

Whenever I query WebSocketImpl.isClosed(), I get false since READYSTATE is set to CLOSING regardless of whether the connection close was normal or abnormal.

Possible Solution

Check the WebSocketImpl.close(int, String, boolean) method and verify that the method does not return without transition READYSTATE from CLOSING to CLOSED.

Steps to Reproduce (for bugs)

  1. Create a Websocket client( and Websocket server if not already)
  2. Ensure that the connection is established between the server and the client.
  3. Stop Websocket server.
  4. Confirm whether READYSTATE is set to CLOSED after the connection is lost or wait until it is set.
  5. Also check whether READYSTATE is transitioned from CLOSING to CLOSED

Debug log (for bugs)

Context

I'm trying to re-establish a connection after a connection is lost.

Your Environment

  • Version used: 1.3.7
  • Java version: JDK 1.8.0
  • Operating System and version: Ubuntu 16.4
  • Endpoint Name and version:
  • Link to your project: Closed source

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions