66import java .nio .channels .NotYetConnectedException ;
77
88import org .java_websocket .drafts .Draft ;
9- import org .java_websocket .exceptions .InvalidDataException ;
109import org .java_websocket .framing .Framedata ;
1110
12- public abstract class WebSocket {
11+ public interface WebSocket {
1312 public enum Role {
1413 CLIENT , SERVER
1514 }
@@ -18,10 +17,6 @@ public enum READYSTATE {
1817 NOT_YET_CONNECTED , CONNECTING , OPEN , CLOSING , CLOSED ;
1918 }
2019
21- public static int RCVBUF = 16384 ;
22-
23- public static /*final*/ boolean DEBUG = false ; // must be final in the future in order to take advantage of VM optimization
24-
2520 /**
2621 * The default port of WebSockets, as defined in the spec. If the nullary
2722 * constructor is used, DEFAULT_PORT will be the port the WebSocketServer
@@ -35,18 +30,16 @@ public enum READYSTATE {
3530 * sends the closing handshake.
3631 * may be send in response to an other handshake.
3732 */
38- public abstract void close ( int code , String message );
33+ public void close ( int code , String message );
3934
40- public abstract void close ( int code );
35+ public void close ( int code );
4136
4237 /**
4338 * This will close the connection immediately without a proper close handshake.
4439 * The code and the message therefore won't be transfered over the wire also they will be forwarded to onClose/onWebsocketClose.
4540 **/
4641 public abstract void closeConnection ( int code , String message );
4742
48- protected abstract void close ( InvalidDataException e );
49-
5043 /**
5144 * Send Text data to the other end.
5245 *
0 commit comments