Example #1
0
func (m Engine) NewClient(conn protocol.Connection) *protocol.Client {
	newClientId := m.ns.Generate()
	msgStore := memory.NewMemoryMsgStore()
	newClient := protocol.NewClient(newClientId, msgStore, m.logger)
	m.clients.AddClient(&newClient)
	return &newClient
}
Example #2
0
func getNewClient() Client {
	msgStore := memory.NewMemoryMsgStore()
	return NewClient(test_ns.Generate(), msgStore, Logger{log.New(os.Stdout, "", 0)})
}