websocket-spec
  1. websocket-spec
  2. WEBSOCKET_SPEC-187

EndPoint javadoc is incorrect about cardinality

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0
    • Fix Version/s: None
    • Labels:
      None

      Description

      The javadoc for EndPoint says that a single instance is created per connection. However this is just a policy implemented by the default ServerEndpoingConfig.Configurator and it is possible (and I'd say advisable) that shared Endpoint instances can be created.

      I suggest that the text be updated to:

      When deployed as a server endpoint, that is to say, the endpoint is registered to a URL, the server uses the registered ServerEndpointConfig instance to obtain an Endpoint instance. ServerEndpointConfig instances using the default ServerEndpointConfig.Configurator instance will instantiate a new Endpoint object for each connection, which means the developer is guaranteed that there will be at most one thread in each endpoint instance. However, alternative ServerEndpointConfig implementations may change the cardinality of the Endpoint so that an instance is shared between many connections, in which case the developer should write thread safe Endpoint code and use the passed Session instance for any per connection handling.

        Activity

          People

          • Assignee:
            dannycoward
            Reporter:
            gregwilkins
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: