Esempio n. 1
0
// newRoom makes a new room hat is ready to go.
// the users of our code need only call the newRoom function
// instead of the more verbose six lines of code.
func newRoom() *room {
	return &room{
		forward: make(chan []byte),
		join:    make(chan *client),
		leave:   make(chan *client),
		clients: make(map[*client]bool),
		tracer:  trace.Off(),
	}
}
Esempio n. 2
0
// newRoom makes a new room hat is ready to go.
// the users of our code need only call the newRoom function
// instead of the more verbose six lines of code.
func newRoom(avatar Avatar) *room {
	return &room{
		forward: make(chan *message),
		join:    make(chan *client),
		leave:   make(chan *client),
		clients: make(map[*client]bool),
		tracer:  trace.Off(),
		avatar:  avatar,
	}
}