1 package org.eclipse.jetty.websocket;
2
3 import java.io.IOException;
4
5 public interface WebSocket
6 {
7 public final byte LENGTH_FRAME=(byte)0x80;
8 public final byte SENTINEL_FRAME=(byte)0x00;
9 void onConnect(Outbound outbound);
10 void onMessage(byte frame,String data);
11 void onMessage(byte frame,byte[] data, int offset, int length);
12 void onDisconnect();
13
14 public interface Outbound
15 {
16 void sendMessage(String data) throws IOException;
17 void sendMessage(byte frame,String data) throws IOException;
18 void sendMessage(byte frame,byte[] data) throws IOException;
19 void sendMessage(byte frame,byte[] data, int offset, int length) throws IOException;
20 void disconnect();
21 boolean isOpen();
22 }
23 }