Fix 14.5, 14.6, 15.1 (#283)

* Update 07.3.md

* Update 07.3.md

* Update 07.6.md

* fix few problems

* Update 10.6 and 10.8

* Update 11.6 and 11.7

* fix some problems before Chap13

* add a dot

* Update 13.9

* little improve

* Thoughts about time.After

* Thoughts about time.After

* Fix 14.6,15.1
This commit is contained in:
王耀
2016-11-20 11:22:57 +08:00
committed by 无闻
parent 6d6c46c6c8
commit f2a3e873fe
6 changed files with 28 additions and 13 deletions

View File

@@ -27,11 +27,11 @@ func main() {
func doServerStuff(conn net.Conn) {
for {
buf := make([]byte, 512)
_, err := conn.Read(buf)
len, err := conn.Read(buf)
if err != nil {
fmt.Println("Error reading", err.Error())
return //终止程序
}
fmt.Printf("Received data: %v", string(buf))
fmt.Printf("Received data: %v", string(buf[:len]))
}
}