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

View File

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