Rename client.kill to client.closeLink

This commit is contained in:
Přemysl Eric Janouch 2018-07-21 00:27:26 +02:00
parent 728fa4e548
commit 6caa4ab928
Signed by: p
GPG Key ID: A0420B94F92B9493
1 changed files with 4 additions and 4 deletions

View File

@ -142,7 +142,7 @@ func initiateShutdown() {
log.Println(err)
}
for c := range clients {
c.kill()
c.closeLink()
}
shutdownTimer = time.After(3 * time.Second)
@ -171,7 +171,7 @@ func (c *client) send(line string) {
}
// Tear down the client connection, trying to do so in a graceful manner.
func (c *client) kill() {
func (c *client) closeLink() {
if c.inShutdown {
return
}
@ -238,7 +238,7 @@ func (c *client) onRead(data []byte, readErr error) {
// TODO: Inform the client about the inQ overrun in the farewell message.
// TODO: We should stop receiving any more data from this client.
if len(c.inQ) > 8192 {
c.kill()
c.closeLink()
return
}
@ -246,7 +246,7 @@ func (c *client) onRead(data []byte, readErr error) {
if c.inShutdown {
c.destroy()
} else {
c.kill()
c.closeLink()
}
} else if readErr != nil {
log.Println(readErr)