Skip to content

Commit 9cdf814

Browse files
committed
GitHub syntax highlighting in the Readme
1 parent 1630bae commit 9cdf814

File tree

1 file changed

+24
-12
lines changed

1 file changed

+24
-12
lines changed

README.markdown

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,23 @@ Running the Example
1313

1414
There's a simple chat server and client example located in the `example`
1515
folder. First, compile the example classes and JAR file:
16-
ant
16+
17+
``` shell
18+
ant
19+
```
1720

1821
Then, start the chat server (a `WebSocketServer` subclass):
1922

20-
java -cp example:dist/WebSocket.jar ChatServer
23+
``` shell
24+
java -cp example:dist/WebSocket.jar ChatServer
25+
```
2126

2227
Now that the server is started, we need to connect some clients. Run the
2328
Java chat client (a `WebSocketClient` subclass):
2429

25-
java -cp example:dist/WebSocket.jar ChatClient
30+
``` shell
31+
java -cp example:dist/WebSocket.jar ChatClient
32+
```
2633

2734
The chat client is a simple Swing GUI application that allows you to send
2835
messages to all other connected clients, and receive messages from others in a
@@ -57,20 +64,25 @@ Testing in Android Emulator
5764
Please note Android Emulator has issues using `IPv6 addresses`. Executing any
5865
socket related code (like this library) inside it will address an error
5966

60-
java.net.SocketException: Bad address family
67+
``` shell
68+
java.net.SocketException: Bad address family
69+
```
6170

6271
You have to manually disable `IPv6` by calling
63-
64-
java.lang.System.setProperty("java.net.preferIPv6Addresses", "false");
65-
java.lang.System.setProperty("java.net.preferIPv4Stack", "true");
72+
73+
``` java
74+
java.lang.System.setProperty("java.net.preferIPv6Addresses", "false");
75+
java.lang.System.setProperty("java.net.preferIPv4Stack", "true");
76+
```
6677

6778
somewhere in your project, before instantiating the `WebSocketClient` class.
6879
You can check if you are currently testing in the Android Emulator like this
69-
70-
if ("google_sdk".equals( Build.PRODUCT ))
71-
{
72-
... disable IPv6
73-
}
80+
81+
``` java
82+
if ("google_sdk".equals( Build.PRODUCT )) {
83+
// ... disable IPv6
84+
}
85+
```
7486

7587

7688
License

0 commit comments

Comments
 (0)