0

I'm creating new jetty javax.websocket server dynamically in the following code.

ServerEndpointConfig serverEndpointConfig = ServerEndpointConfig.Builder.create(
     WebSocketVpnServerChannel.class, "/" + path + "/vpn/").build();
instance.wsServerContainer.addEndpoint(serverEndpointConfig);

I need to get these instances to validate if no longer in use to destroy them.

Joakim Erdfelt
  • 46,896
  • 7
  • 86
  • 136
Roberto
  • 169
  • 9

1 Answers1

0

You don't.

The use of .addEndpoint() merely adds a configuration (not an actual endpoint) for the server to know how to create websocket endpoints if an incoming WebSocket upgrade request arrives to that specified path.

The container will create the Endpoints on upgrade and destroy them when the close handshake is completed (normally or abnormally)

Joakim Erdfelt
  • 46,896
  • 7
  • 86
  • 136