Beispiel #1
0
// Start creates the tcp listener and starts the connection handler in a goroutine
func (s *Server) Start() (err error) {
	logger.Info("Starting game server...")

	s.ln, err = net.Listen("tcp", s.laddr)
	if err != nil {
		return fmt.Errorf("couldn't start game server: %v", err)
	}

	s.nextIndex = id.Generator()

	s.t.Go(s.run)
	return nil
}
Beispiel #2
0
func init() {
	indexChan = id.Generator()
}
Beispiel #3
0
func init() {
	nextId = id.Generator()
}