From cb2bebbabc7ae6b20202de9626134d2082fb7273 Mon Sep 17 00:00:00 2001 From: Patrik Cyvoct Date: Tue, 8 May 2018 20:40:00 +0200 Subject: [PATCH] Fix ping message Init message type before calling ping loop Signed-off-by: Patrik Cyvoct --- gotty-client.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gotty-client.go b/gotty-client.go index 103c549..4a896fd 100644 --- a/gotty-client.go +++ b/gotty-client.go @@ -246,6 +246,9 @@ func (c *Client) Connect() error { return err } + // Initialize message types for gotty + c.initMessageType() + go c.pingLoop() return nil @@ -300,8 +303,6 @@ func (c *Client) ExitLoop() { // Loop will look indefinitely for new messages func (c *Client) Loop() error { - // Initialize message types for gotty - c.initMessageType() if !c.Connected { err := c.Connect()