private support for your internal/customer projects ... custom extensions and distributions ... versioned snapshots for indefinite support ... scalability guidance for your apps and Ajax/Comet projects ... development services from 1 day to full product delivery
Jetty also provides a Jetty WebSocket Client Library to write make talking to WebSocket servers easier.
To use the Jetty WebSocket Client on your own Java project you will need the following maven artifacts.
To use the WebSocketClient you will need to hook up a WebSocket object instance to a specific destination WebSocket URI.
The above example connects to a remote WebSocket server and hands off a SimpleEchoSocket to perform the logic on the websocket once connected, waiting for the socket to register that it has closed.
When the SimpleEchoSocket connects, it sends 2 Text messages and then closes the socket.
The onMessage(String msg) receives the responses from the remote server WebSocket and outputs them to the console.