users@websocket-spec.java.net

[jsr356-users] Re: [jsr356-experts] Re: Re: Feedback pls ! Re: connectToServer

From: <peter.doschkinow_at_oracle.com>
Date: Thu, 7 Mar 2013 14:46:15 +0000 (GMT)

Hi Danny,

do I understand it right that you are going to add a method like
container.connectToServer(<client endpoint instance>, URI uri)
to the WebSocketContainer API?

I think this is an important change to do.
A couple of weeks ago I wrote a JavaFX websocket client using the
websocket Tyrus specific API in the initialization code:
...
wsClient = new WSClient(drawingPane);
URI wsURI = new URI("ws://localhost:8080/whiteboard/websocket");
ClientManager cliContainer = ClientManager.createClient();
cliContainer.connectToServer(wsClient, wsURI);
...

Note that it allows me to configure the websocket client endpoint
instance that connects to the server with a certain JavaFX pane.
Trying to use only the implementation independent javax.websocket API,
I have to use:
container.connectToServer(WSClient.class, wsURI)

and so I am not able to configure the WSClient instance used and get
hold of the JavaFX pane I need, without complex workarounds.


Thanks,
Peter