func startPacketInfoChan(c chan *packetInfo) {
	for {
		pi := <-c
		err := pi.processReceivedMessage()
		if err != nil {
			pi.conn.Close()
			log.Warnf(logCommunication+"Message processor error: %s\n", err)
		}
	}
}
startPacketInfoChan starts a loop reading messages.
package server
import (
	"bufio"
	"bytes"
	"encoding/binary"
	"net"
	"time"
	"github.com/cashshuffle/cashshuffle/message"
	"github.com/golang/protobuf/proto"
	log "github.com/sirupsen/logrus"
)
const (
	maxMessageLength = 64 * 1024
)
var (
	magicBytes = []byte{66, 188, 195, 38, 105, 70, 120, 115}
	headerLength = 12
)