Beispiel #1
0
func (this *MyHandlerImpl) Handle(client *client.Client, data *protocol.Protocol) *client.Client {
	logger.Info("TODO: MyHandlerImpl data =  %v \n", data)
	switch data.Command {
	case 0:
		//TODO:
		client.Send(data.ModuleId, data.Command, data.Data)
		break
	default:
		//TODO:
		break
	}
	return nil
}
func (this *WsUserHandlerImpl) Handle(client *client.Client, command string, data string) *client.Client {
	logger.Info("TODO: WsUserHandlerImpl data =  %v \n", data)
	switch command {
	case "echo":
		//TODO:
		logger.Info("echo server \n")
		client.WsSend("user", "echo", data)
		break
	default:
		//TODO:
		break
	}
	return nil
}