Exemplo n.º 1
0
func ConnectJudger(host string, port int, password string) error {
	J = make(map[string]interface{})

	cli, err := client.New(host, port, password)
	J["default"] = cli

	if err != nil {
		log.Warnln(err)
		return err
	}

	cli.SetDebug(true)

	return nil
}
Exemplo n.º 2
0
func Test_TCP(t *testing.T) {
	cli, err := client.New("duguying.net", 1004, "123456789")

	if err != nil {
		fmt.Println(err)
	}

	response, err := cli.AddTask(12, "C", "int main(){return 0;}")

	if err != nil {
		fmt.Println(err)
	} else {
		fmt.Println(response)
	}

	response, err = cli.GetStatus(12)

	if err != nil {
		fmt.Println(err)
	} else {
		fmt.Println(response)
	}

}