|
47 | 47 | * <i>onClientMessage</i> callbacks. |
48 | 48 | * |
49 | 49 | */ |
50 | | -public final class WebSocketImpl extends WebSocket { |
| 50 | +public class WebSocketImpl extends WebSocket { |
51 | 51 |
|
52 | 52 | /** |
53 | 53 | * Determines whether to receive data as part of the |
@@ -105,7 +105,6 @@ public final class WebSocketImpl extends WebSocket { |
105 | 105 | * they occur. |
106 | 106 | */ |
107 | 107 |
|
108 | | - |
109 | 108 | public WebSocketImpl( WebSocketListener listener , List<Draft> drafts , Socket sock ) { |
110 | 109 | this( listener, (Draft) null, sock ); |
111 | 110 | this.role = Role.SERVER; |
@@ -599,14 +598,18 @@ private void write( List<ByteBuffer> bufs ) { |
599 | 598 | } |
600 | 599 |
|
601 | 600 | private void deliverMessage( Framedata d ) throws InvalidDataException { |
602 | | - if( d.getOpcode() == Opcode.TEXT ) { |
603 | | - wsl.onWebsocketMessage( this, Charsetfunctions.stringUtf8( d.getPayloadData() ) ); |
604 | | - } else if( d.getOpcode() == Opcode.BINARY ) { |
605 | | - wsl.onWebsocketMessage( this, d.getPayloadData() ); |
606 | | - } else { |
607 | | - if( DEBUG ) |
608 | | - System.out.println( "Ignoring frame:" + d.toString() ); |
609 | | - assert ( false ); |
| 601 | + try { |
| 602 | + if( d.getOpcode() == Opcode.TEXT ) { |
| 603 | + wsl.onWebsocketMessage( this, Charsetfunctions.stringUtf8( d.getPayloadData() ) ); |
| 604 | + } else if( d.getOpcode() == Opcode.BINARY ) { |
| 605 | + wsl.onWebsocketMessage( this, d.getPayloadData() ); |
| 606 | + } else { |
| 607 | + if( DEBUG ) |
| 608 | + System.out.println( "Ignoring frame:" + d.toString() ); |
| 609 | + assert ( false ); |
| 610 | + } |
| 611 | + } catch ( RuntimeException e ) { |
| 612 | + wsl.onWebsocketError( this, e ); |
610 | 613 | } |
611 | 614 | } |
612 | 615 |
|
|
0 commit comments