mirror of
https://github.com/yudai/gotty.git
synced 2025-09-22 05:50:48 +02:00
Refactor
This commit is contained in:
parent
54403dd678
commit
a6133f34b7
54 changed files with 2140 additions and 1334 deletions
17
server/timer.go
Normal file
17
server/timer.go
Normal file
|
@ -0,0 +1,17 @@
|
|||
package server
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
func (server *Server) stopTimer() {
|
||||
if server.options.Timeout > 0 {
|
||||
server.timer.Stop()
|
||||
}
|
||||
}
|
||||
|
||||
func (server *Server) resetTimer() {
|
||||
if server.options.Timeout > 0 {
|
||||
server.timer.Reset(time.Duration(server.options.Timeout) * time.Second)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue