From e040822a92b21369cc69169dc23a088c8f7787c9 Mon Sep 17 00:00:00 2001 From: ed Date: Mon, 14 Mar 2016 07:17:05 -0400 Subject: [PATCH] Use fmt.Fprintf to write messages to client connections --- client.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/client.go b/client.go index 5cc7adb..376242f 100644 --- a/client.go +++ b/client.go @@ -303,10 +303,8 @@ func (c *Client) writeThread(signalChan chan signalCode, outputChan chan string) return } case output := <-outputChan: - line := []byte(fmt.Sprintf("%s\r\n", output)) - c.connection.SetWriteDeadline(time.Now().Add(time.Second * 30)) - if _, err := c.connection.Write(line); err != nil { + if _, err := fmt.Fprintf(c.connection, "%s\r\n", output); err != nil { c.disconnect() return }