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()