Skip to content

Freezing in go routine #21

@Blendman974

Description

@Blendman974

The program hangs when this api in repeatedly used in a go routine. See following code :

package main

import (
	"fmt"
	"github.com/multiplay/go-ts3"
)


func main() {

	conn, err := ts3.NewClient("ts.foo.bar:10011")

	if err != nil {
		fmt.Println("ERROR : ", err)
	}

	if err := conn.Login("foo", "bar"); err != nil {
		fmt.Println("ERROR : ", err)
	}

	if err := conn.Use(1); err != nil {
		fmt.Println("ERROR : ", err)
	}


	go loop(conn) //Here if you remove the "go", the program will work as expected. 

	for {

	}
}

func loop(conn *ts3.Client){
	for  {

		//time.Sleep(time.Second*10) //waiting doesn't matter, you may wait an hour it will still hang

		conn.Server.GroupList() //The program will hang after 4 iteration of GroupList() or 40-50 iteration of ClientDBList() but all commands eventually hang after a while
		fmt.Println("Tick")

	}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions