Fix ping message

Init message type before calling ping loop

Signed-off-by: Patrik Cyvoct <patrik@ptrk.io>
This commit is contained in:
Patrik Cyvoct 2018-05-08 20:40:00 +02:00
parent dfc14ad646
commit cb2bebbabc
No known key found for this signature in database
GPG Key ID: D9105E724B0143B2
1 changed files with 3 additions and 2 deletions

View File

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