users@websocket-spec.java.net

[jsr356-users] Re: Annotated _at_ClientEndpoints: How does a Client Connect To A Remote Endpoint?

From: Peter Pilgrim <peter.pilgrim_at_gmail.com>
Date: Tue, 12 Mar 2013 07:15:05 +0000

Hey Jitendra

Thanks for that information.

On 12 March 2013 04:27, Jitendra Kotamraju
<jitendra.kotamraju_at_oracle.com> wrote:
> On 3/11/13 5:01 PM, peter.pilgrim_at_gmail.com wrote:
>
> Hello All
>
> Annotated @ClientEndpoints: How does a Client Connect To A Remote
> Endpoint?
>
> How does a developer connect the remote WebSocket with just
> annotations?
>
> import javax.websocket.ClientEndpoint;
> import javax.websocket.OnMessage;
> import javax.websocket.Session;
>
> @ClientEndpoint
> public class ClientEchoEndpoint {
>
> @OnMessage
> public void messageReceived( Session session, String text ) {
> System.out.printf("message from the server text: %s\n", text);
> }
> }
>
> Assuming the code runs inside a Java EE7 container.
>
> Also is the client side programmatic API example out there for
> everybody to see?
>
> You need to write code to connect it to server endpoint.
> ContainerProvider.getWebSocketContainer.connectToServer(...)
>
>



-- 
Peter Pilgrim,