Esempio n. 1
0
func (ctx *context) send(msg backend.Message) error {
	log.Printf("[backend-net] SND(%d)", msg.Opcode())
	backend.Put(ctx.conn, msg.Opcode())
	return msg.Serialize(ctx.conn)
}
Esempio n. 2
0
func (client *Client) Send(msg backend.Message) error {
	log.Printf("[backend-net-client-%04d] SND(%d)", client.id, msg.Opcode())

	backend.Put(client, msg.Opcode())
	return msg.Serialize(client)
}