org.eclipse.jetty.websocket
Class TestClient
java.lang.Object
org.eclipse.jetty.websocket.TestClient
- All Implemented Interfaces:
- WebSocket, WebSocket.OnFrame
public class TestClient
- extends Object
- implements WebSocket.OnFrame
- Version:
- $Revision$ $Date$
This is not a general purpose websocket client.
It's only for testing the websocket server and is hardwired to a specific draft version of the protocol.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TestClient
public TestClient(String host,
int port,
String protocol,
int timeoutMS)
throws Exception
- Throws:
Exception
onOpen
public void onOpen(WebSocket.Connection connection)
- Description copied from interface:
WebSocket
- Called when a new websocket connection is accepted.
- Specified by:
onOpen
in interface WebSocket
- Parameters:
connection
- The Connection object to use to send messages.
onClose
public void onClose(int closeCode,
String message)
- Description copied from interface:
WebSocket
- Called when an established websocket connection closes
- Specified by:
onClose
in interface WebSocket
onFrame
public boolean onFrame(byte flags,
byte opcode,
byte[] data,
int offset,
int length)
- Description copied from interface:
WebSocket.OnFrame
- Called when any websocket frame is received.
- Specified by:
onFrame
in interface WebSocket.OnFrame
- Returns:
- true if this call has completely handled the frame and no further processing is needed (including aggregation and/or message delivery)
onHandshake
public void onHandshake(WebSocket.FrameConnection connection)
- Specified by:
onHandshake
in interface WebSocket.OnFrame
ping
public void ping(byte opcode,
byte[] data,
int fragment)
throws Exception
- Throws:
Exception
disconnect
public void disconnect()
throws Exception
- Throws:
Exception
main
public static void main(String[] args)
throws Exception
- Throws:
Exception
Copyright © 1995-2011 Mort Bay Consulting. All Rights Reserved.