示例#1
0
文件: server.go 项目: gemrs/gem
// 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
}
示例#2
0
文件: index.go 项目: gemrs/gem
func init() {
	indexChan = id.Generator()
}
示例#3
0
文件: listener.go 项目: gemrs/gem
func init() {
	nextId = id.Generator()
}