Skip to content

Commit be7023b

Browse files
author
Liming Xie
committed
update readme and comments
1 parent 27cc284 commit be7023b

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

Demo/SocketIOScript.cs

+2-5
Original file line numberDiff line numberDiff line change
@@ -53,21 +53,18 @@ void DoOpen() {
5353
if (socket == null) {
5454
socket = IO.Socket (serverURL);
5555
socket.On (Socket.EVENT_CONNECT, () => {
56-
//Debug.Log ("Socket.IO connected");
5756
lock(chatLog) {
57+
// Access to Unity UI is not allowed in a background thread, so let's put into a shared variable
5858
chatLog.Add("Socket.IO connected.");
5959
}
6060
});
6161
socket.On ("chat", (data) => {
62-
//Debug.Log(data);
63-
6462
string str = data.ToString();
65-
//Debug.Log(str);
6663

6764
ChatData chat = JsonConvert.DeserializeObject<ChatData> (str);
6865
string strChatLog = "user#" + chat.id + ": " + chat.msg;
69-
//Debug.Log (strChatLog);
7066

67+
// Access to Unity UI is not allowed in a background thread, so let's put into a shared variable
7168
lock(chatLog) {
7269
chatLog.Add(strChatLog);
7370
}

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ This library supports all of the features the JS client does, including events,
4747
Mono, .NET 2.0
4848

4949
## Demo
50-
* [Example code for Socket.IO](Demo/SocketIOScript.cs)
51-
52-
Unzip the test-server.zip, it's a nodejs app for testing purpose.
50+
* [node.js example code, chat server](Demo/test-server/index.js)
51+
* [HTML example code, web-based chat client](Demo/test-server/index.html)
52+
* [Unity C# example code, chat client](Demo/SocketIOScript.cs)
5353

5454
## Comparison
5555

0 commit comments

Comments
 (0)