Skip to content

Commit

Permalink
add read timeout when first reading data
Browse files Browse the repository at this point in the history
  • Loading branch information
ckrissun committed Apr 5, 2016
1 parent 227c325 commit f877a7d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions main.go
Expand Up @@ -141,6 +141,8 @@ func handleConn(c net.Conn) {
}
}()

c.SetReadDeadline(time.Now().Add(_ConnReadTimeout))

rdr := bufio.NewReader(c)

addr, err := handleBinaryHdr(rdr, c)
Expand Down

0 comments on commit f877a7d

Please sign in to comment.