Example #1
0
func (h *handler) OnMessage(reader *lendecoder.ReadBuffer) {
	count := 0
	for _, b := range reader.Buffer() {
		count += int(b)
	}
	reply := make([]byte, 2)
	reply[0] = byte(count >> 8)
	reply[1] = byte(count)
	h.writer.Write(reply)
}