We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c590132 commit 8c8af14Copy full SHA for 8c8af14
ebook/08.1.md
@@ -256,7 +256,7 @@ Go语言中通过net包中的`DialTCP`函数来建立一个TCP连接,并返回
256
func handleClient(conn net.Conn) {
257
conn.SetReadDeadline(time.Now().Add(2 * time.Minute)) // set 2 minutes timeout
258
request := make([]byte, 128) // set maxium request length to 128KB to prevent flood attack
259
-
+ defer conn.Close() // close connection before exit
260
for {
261
read_len, err := conn.Read(request)
262
0 commit comments