Skip to content

Commit 49b5500

Browse files
committed
in progress commit
1 parent 8f8ac48 commit 49b5500

6 files changed

Lines changed: 13 additions & 17 deletions

File tree

‎example/AutobahnClientTest.java‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,7 @@ public static void main( String[] args ) {
127127

128128
@Override
129129
public void onMessage( String message ) {
130-
try {
131-
send( message );
132-
} catch ( InterruptedException e ) {
133-
e.printStackTrace();
134-
}
135-
130+
send( message );
136131
}
137132

138133
@Override

‎example/ChatClient.java‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,9 @@ public void actionPerformed( ActionEvent e ) {
9090

9191
if( e.getSource() == chatField ) {
9292
if( cc != null ) {
93-
try {
94-
cc.send( chatField.getText() );
95-
chatField.setText( "" );
96-
chatField.requestFocus();
97-
} catch ( InterruptedException ex ) {
98-
ex.printStackTrace();
99-
}
93+
cc.send( chatField.getText() );
94+
chatField.setText( "" );
95+
chatField.requestFocus();
10096
}
10197

10298
} else if( e.getSource() == connect ) {
@@ -114,6 +110,7 @@ public void onMessage( String message ) {
114110
public void onOpen( ServerHandshake handshake ) {
115111
ta.append( "You are connected to ChatServer: " + getURI() + "\n" );
116112
ta.setCaretPosition( ta.getDocument().getLength() );
113+
send( "\0" );
117114
}
118115

119116
@Override

‎example/ChatServer.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public ChatServer( InetSocketAddress address ) {
2626
@Override
2727
public void onOpen( WebSocket conn, ClientHandshake handshake ) {
2828
try {
29-
this.sendToAll( "new" );
29+
this.sendToAll( "\0" );
3030
} catch ( InterruptedException ex ) {
3131
ex.printStackTrace();
3232
}

‎example/ServerStressTest.java‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,6 @@ public void send() {
203203
cl.flush();
204204
} catch ( NotYetConnectedException e ) {
205205
notyetconnected++;
206-
} catch ( InterruptedException e ) {
207-
e.printStackTrace();
208206
}
209207
}
210208
}

‎src/org/java_websocket/WebSocketClient.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public void close() {
132132
* @param text
133133
* The String to send to the WebSocket server.
134134
*/
135-
public void send( String text ) throws NotYetConnectedException , InterruptedException {
135+
public void send( String text ) throws NotYetConnectedException {
136136
if( conn != null ) {
137137
conn.send( text );
138138
}

‎src/org/java_websocket/util/Charsetfunctions.java‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,10 @@ public static String stringUtf8( ByteBuffer bytes ) throws InvalidDataException
8181
}
8282
return s;
8383
}
84+
85+
public static void main( String[] args ) throws InvalidDataException {
86+
stringUtf8( utf8Bytes( "\0" ) );
87+
stringAscii( asciiBytes( "\0" ) );
88+
}
89+
8490
}

0 commit comments

Comments
 (0)