go.talks/present: amend some comments
R=r
CC=golang-dev
https://golang.org/cl/6724053
diff --git a/present/socket.go b/present/socket.go
index 20c2a82..0cfd146 100644
--- a/present/socket.go
+++ b/present/socket.go
@@ -48,15 +48,13 @@
}
// socketHandler handles the websocket connection for a given present session.
-// It constructs a new Client and handles transcoding Messages to and from JSON
-// format, sending and receiving those messages on the Client's in and out
-// channels.
+// It handles transcoding Messages to and from JSON format, and starting
+// and killing Processes.
func socketHandler(c *websocket.Conn) {
- proc := make(map[string]*Process)
in, out := make(chan *Message), make(chan *Message)
errc := make(chan error, 1)
- // Decode messages from client and take the relevant action.
+ // Decode messages from client and send to the in channel.
go func() {
dec := json.NewDecoder(c)
for {
@@ -80,7 +78,8 @@
}
}()
- // Handle input.
+ // Start and kill Processes and handle errors.
+ proc := make(map[string]*Process)
for {
select {
case m := <-in:
@@ -174,7 +173,7 @@
return cmd, nil
}
-// Wait waits for the running process to complete and returns its error state.
+// wait waits for the running process to complete and returns its error state.
func (p *Process) wait(cmd *exec.Cmd) {
defer close(p.done)
p.end(cmd.Wait())