interactive tmsp console

This commit is contained in:
Ethan Buchman
2015-11-30 20:56:36 -05:00
parent 7448cdc154
commit 93308a3e6f
2 changed files with 49 additions and 19 deletions

View File

@@ -3,6 +3,7 @@ package server
import (
"bufio"
"fmt"
"io"
"net"
"strings"
@@ -86,7 +87,11 @@ func handleRequests(appC types.AppContext, closeConn chan error, conn net.Conn,
var req types.Request
wire.ReadBinaryPtr(&req, bufReader, 0, &n, &err)
if err != nil {
closeConn <- fmt.Errorf("Error in handleRequests: %v", err.Error())
if err == io.EOF {
closeConn <- fmt.Errorf("Connection closed by client")
} else {
closeConn <- fmt.Errorf("Error in handleRequests: %v", err.Error())
}
return
}
count++