Skip to content

Commit

Permalink
Issue #5828 - only use the HttpClient constructor for JavaxWebSocketC…
Browse files Browse the repository at this point in the history
…lientContainer

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
  • Loading branch information
lachlan-roberts committed Feb 15, 2021
1 parent 0e4ed5c commit b69f470
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
Expand Up @@ -53,9 +53,7 @@ public static void stop(WebSocketContainer container) throws Exception
@Override
public WebSocketContainer getContainer()
{
JavaxWebSocketClientContainer clientContainer = new JavaxWebSocketClientContainer();
registerShutdown(clientContainer);
return clientContainer;
return getContainer(null);
}

/**
Expand Down
Expand Up @@ -70,17 +70,12 @@ public JavaxWebSocketClientContainer()
*/
public JavaxWebSocketClientContainer(final HttpClient httpClient)
{
this(new WebSocketComponents(), (wsComponents) -> new WebSocketCoreClient(httpClient, wsComponents));
this(new WebSocketComponents(), (components) -> new WebSocketCoreClient(httpClient, components));
}

public JavaxWebSocketClientContainer(WebSocketComponents components)
{
this(components, (wsComponents) ->
{
WebSocketCoreClient coreClient = new WebSocketCoreClient(wsComponents);
coreClient.getHttpClient().setName("Javax-WebSocketClient@" + Integer.toHexString(coreClient.getHttpClient().hashCode()));
return coreClient;
});
this(components, WebSocketCoreClient::new);
}

public JavaxWebSocketClientContainer(WebSocketComponents components, Function<WebSocketComponents, WebSocketCoreClient> coreClientFactory)
Expand Down

0 comments on commit b69f470

Please sign in to comment.