Пример #1
0
func NewMinorConfig(config *MinorConfigEntity) *MinorConfig {
	m := new(MinorConfig)
	m.server = base.NewBaseProtocolTcpServer(config.serverPort, m)
	clientEntity := new(base.BaseClientEntity)
	clientEntity.ID = config.clientID
	clientEntity.Version = config.version
	m.client = base.NewBaseProtocolTcpClient(clientEntity, m)
	m.config = config
	m.connectedMicroServerNum = 0
	m.connectedMicroServerAddress = make(map[int]string)
	return m
}
Пример #2
0
func NewMajorConfig(port int) *MajorConfig {
	m := new(MajorConfig)
	m.server = base.NewBaseProtocolTcpServer(port, m)
	m.minors = make(map[int]*minorInfo)
	return m
}