@@ -12,7 +12,9 @@ public interface WebSocketListener {
1212 /**
1313 * Called on the server side when the socket connection is first established, and the WebSocket
1414 * handshake has been received.
15- *
15+ *
16+ * @param conn
17+ * The WebSocket related to this event
1618 * @param draft
1719 * The protocol draft the client uses to connect
1820 * @param request
@@ -21,19 +23,35 @@ public interface WebSocketListener {
2123 * @throws InvalidDataException
2224 * Throwing this exception will cause this handshake to be rejected
2325 */
24- public HandshakeBuilder onHandshakeRecievedAsServer ( WebSocket conn , Draft draft , Handshakedata request ) throws InvalidDataException ;
26+ public HandshakeBuilder onHandshakeReceivedAsServer (WebSocket conn , Draft draft , Handshakedata request ) throws InvalidDataException ;
27+
2528 /**
2629 * Called on the client side when the socket connection is first established, and the WebSocket
2730 * handshake response has been received.
28- *
31+ *
32+ * @param conn
33+ * The WebSocket related to this event
2934 * @param request
3035 * The handshake initially send out to the server by this websocket.
3136 * @param response
3237 * The handshake the server sent in response to the request.
3338 * @throws InvalidDataException
3439 * Allows the client to reject the connection with the server in respect of its handshake response.
3540 */
36- public void onHandshakeRecievedAsClient ( WebSocket conn , Handshakedata request , Handshakedata response ) throws InvalidDataException ;
41+ public void onHandshakeReceivedAsClient (WebSocket conn , Handshakedata request , Handshakedata response ) throws InvalidDataException ;
42+
43+ /**
44+ * Called on the client side when the socket connection is first established, and the WebSocket
45+ * handshake has just been sent.
46+ *
47+ * @param conn
48+ * The WebSocket related to this event
49+ * @param request
50+ * The handshake sent to the server by this websocket
51+ * @throws InvalidDataException
52+ * Allows the client to stop the connection from progressing
53+ */
54+ public void onHandshakeSentAsClient ( WebSocket conn , Handshakedata request ) throws InvalidDataException ;
3755
3856 /**
3957 * Called when an entire text frame has been received. Do whatever you want
@@ -58,9 +76,9 @@ public interface WebSocketListener {
5876 public void onMessage ( WebSocket conn , byte [] blob );
5977
6078 /**
61- * Called after <var>onHandshakeRecieved </var> returns <var>true</var>.
79+ * Called after <var>onHandshakeReceived </var> returns <var>true</var>.
6280 * Indicates that a complete WebSocket connection has been established,
63- * and we are ready to send/recieve data.
81+ * and we are ready to send/receive data.
6482 *
6583 * @param conn
6684 * The <tt>WebSocket</tt> instance this event is occuring on.
0 commit comments