package ws

import (
	"common/utils"
	"robot/config"
	"strconv"
	"time"
)

type Manager struct {
	addr string
}

func NewManager(addr string) *Manager {
	c := &Manager{
		addr: addr,
	}
	return c
}

func (c *Manager) Start() {
	cfg := config.Get().Client
	for i := int32(0); i < cfg.Count; i++ {
		client := NewClient(c.addr, strconv.Itoa(utils.RandInt(int(cfg.USN[0]), int(cfg.USN[1]))))
		client.Start()
		time.Sleep(time.Millisecond * 10)
	}
}
