Ejemplo n.º 1
0
func (con *Connection) receiveLoop() {
	for {
		log.Finest("Waiting for packet..")
		packet, err := packets.ReadPacket(con.conn)
		if err != nil {
			log.Error("Failure in receive loop: %v", err)
			return
		}
		log.Fine("got packet %v", packet.PacketID())

		// put into receive queue
		con.Session.RXQueue <- packet
	}
}
Ejemplo n.º 2
0
func main() {
	// Load the configuration (isn't this easy?)
	l4g.LoadConfiguration("example.xml")

	l4g.Finest("This will only go to those of you really cool UDP kids!  If you change enabled=true.")
	l4g.Info("About .....")
	l4g.Trace("About that time, eh chaps?")
	l4g.Trace("About that time, eh chaps?")
	l4g.Trace("About that time, eh chaps?")
	l4g.Debug("About that time, eh chaps?")
	l4g.Info("About that time, eh chaps?")
	l4g.Warn("About that time, eh chaps?")
	select {}
}