I too had similar issues with the outdated docs. I managed to use the examples 
that Joakim posted to come up with a working example that may help out as an 
additional reference:

 

https://code.google.com/p/ugate/source/browse/trunk/src/main/java/org/ugate/service/web/UGateWebSocket.java?spec=svn315&r=315

https://code.google.com/p/ugate/source/browse/trunk/src/main/java/org/ugate/service/web/UGateWebSocketServlet.java?r=315

https://code.google.com/p/ugate/source/browse/trunk/src/main/java/org/ugate/service/web/WebServer.java?r=315

 

From: [email protected] [mailto:[email protected]] 
On Behalf Of Max Kington
Sent: Wednesday, April 17, 2013 5:50 PM
To: [email protected]
Subject: Re: [jetty-users] WebSocketClient - with 2013-04-08

 

That's great. 

 

I may blog this as I go if you're going to hit the documentation although I 
hate doing that when it's so little value add.

 

Cheers for the quick response, 

Max

 

 

Sent from Samsung Mobile




-------- Original message --------
From: Joakim Erdfelt <[email protected]> 
Date: 
To: JETTY user mailing list <[email protected]> 
Subject: Re: [jetty-users] WebSocketClient - with 2013-04-08 



That is correct.

The early Milestones for the websocket API used WebSocketConnection and 
RemoteEndpoint.write*().

 

During the milestones the API slowly evolved to take on some of naming and 
behavior from JSR-356 (The Java WebSocket API).

 

This resulted in a name change from WebSocketConnection to Session

and RemoteEndpoint.write*() to RemoteEndpoint.send*()

Along with a few smaller configuration variables name changes.

 

I'm ashamed of the age of websocket documentation in this regard. :-(

I'll tackle this immediately.

 

In the meantime you can browse the test cases to find some techniques.

 

https://github.com/eclipse/jetty.project/tree/master/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/examples

 

 




--

Joakim Erdfelt <[email protected]>

webtide.com <http://www.webtide.com/> 

Developer advice, services and support
from the Jetty & CometD experts

eclipse.org/jetty <http://eclipse.org/jetty/>  - cometd.org 
<http://cometd.org/> 

 

On Wed, Apr 17, 2013 at 1:47 PM, Max Kington <[email protected]> wrote:

Hi there,

I've been playing with websockets in Jetty 9, I'm currently using
2013-04-08.  Clearly the api is in flux somewhat so examples on the
t'internet seem to be a little out of date.  Also for alot of the client
source, many of the relevent git links reference dead or defunct
branches and stacks of now dead code.

I *think* I've worked out the changes in WebSocketListener
onWebSocketConnect(WebSocketConnection) -> onWebSocketConnect(Session)
and send messages back and forth using
session.getRemoteEndPoint().send*().  I noticed though that the methods
have gone from write*() to send*() so I just would like confirming that
I'm not too close to the metal and I am using the appropriate level of
abstraction (i.e. the as far away from the guts until I have e genuine
need to go lower).

I found,
http://jetty.4.x6.nabble.com/jetty-users-Jetty-9-and-WebSocket-td4960163.html#a4960172,
which suggests a chap is doing the same but never saw that tailed.

My use case fwiw will involve a number of non browser based clients so
I'm going to be very biased towards using these libraries.

Cheers,
Max Kington

p.s. Can I update docs/wiki somewhere with examples as I go?
_______________________________________________
jetty-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/jetty-users

 

_______________________________________________
jetty-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/jetty-users

Reply via email to