Skip to content

Commit 2d733e3

Browse files
author
Kristijan Sedlak
committed
updating chat client example (adding onIOError)
1 parent daabf82 commit 2d733e3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

example/ChatClient.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
import javax.swing.JTextArea;
1313
import javax.swing.JTextField;
1414

15+
import android.util.Log;
16+
1517
import net.tootallnate.websocket.WebSocketClient;
1618
import net.tootallnate.websocket.WebSocketDraft;
1719

@@ -38,6 +40,11 @@ public void onClose() {
3840
ta.append("You have been disconnected from: " + getURI() + "\n");
3941
}
4042

43+
public void onIOError(IOException ex) {
44+
super.onIOError(ex);
45+
ta.append("Network problem ...\n");
46+
}
47+
4148
/**
4249
* The JFrame for our Chat client.
4350
*/

0 commit comments

Comments
 (0)