Skip to content

Commit

Permalink
Updated comments
Browse files Browse the repository at this point in the history
  • Loading branch information
wrichter committed Aug 4, 2017
1 parent 3a6191b commit 12d126c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ after ```//additional code here ``` ):
1. When message is received via websocket,
draw a circle with the specified coordinates, radius and color:
```
// draw circle upon message from server
// when a message is received from the server, draw a circle
ws.onmessage = function(event) {
statusline.innerHTML = 'connection #' + numconns + ' ' + event.data;
var msg = JSON.parse(event.data);
Expand Down Expand Up @@ -122,15 +122,15 @@ close old socket if necessary:
1. Remove mouseup handler when connection is closed:
```
// stop sending clicks to server when connection is closed
// when connection is closed, stop sending clicks to server
ws.onclose = function() {
canvas.removeEventListener("mouseup", click, false);
}
```
1. Reconnect to server upon connection loss with 1 sec delay:
```
// reconnect to server upon connection loss
// when connection is lost, reconnect to server
ws.onerror = function() {
reconnectafter(1000);
}
Expand Down

0 comments on commit 12d126c

Please sign in to comment.