mirror of
https://github.com/renorris/openfsd
synced 2026-04-26 18:55:45 +08:00
add client timeout via net/Conn SetDeadline
This commit is contained in:
@@ -108,6 +108,8 @@ func (s *Server) eventLoop(client *Client) {
|
||||
go client.senderWorker()
|
||||
|
||||
for {
|
||||
// Set deadline and attempt to read
|
||||
client.conn.SetReadDeadline(getTimeBySecondsInFuture(s.cfg.ConnectionTimeoutSeconds))
|
||||
if !client.scanner.Scan() {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user