当前位置: 首页>>代码示例>>Golang>>正文


Golang Client.CancelWaitRegist方法代码示例

本文整理汇总了Golang中NetCore.Client.CancelWaitRegist方法的典型用法代码示例。如果您正苦于以下问题:Golang Client.CancelWaitRegist方法的具体用法?Golang Client.CancelWaitRegist怎么用?Golang Client.CancelWaitRegist使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NetCore.Client的用法示例。


在下文中一共展示了Client.CancelWaitRegist方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: handleServerRegist

func handleServerRegist(client *NetCore.Client, msg *NetCore.NetMsg) bool {
	if client != courier {
		Logger.Warn(LogConf.Admin, LogConf.SERVER, "handleServerRegist error, %v %d!", courier, client.Idx)
		return false
	}
	client.CancelWaitRegist()

	Logger.Info(LogConf.Admin, LogConf.SERVER, "handleServerRegist OK, %v %d!", courier, client.Idx)

	NetCore.MarkServer(client, NetConf.Courier)

	return true
}
开发者ID:ccppluagopy,项目名称:Zebra,代码行数:13,代码来源:Handlers.go

示例2: handleServerRegist

func handleServerRegist(client *NetCore.Client, msg *NetCore.NetMsg) bool {
	stype := binary.LittleEndian.Uint32(msg.Buf)
	NetCore.MarkServer(client, stype)
	addServerToMap(client)
	client.AddCloseCB("removeServer", removeServerFromMap)
	client.CancelWaitRegist()

	Logger.Info(LogConf.CourierServerJob, LogConf.SERVER, "handleServerRegist client idx: %d buf len: %d %d", client.Idx, len(msg.Buf), stype)

	binary.LittleEndian.PutUint32(msg.Buf[0:4], NetConf.Courier)
	client.SendMsg(msg)

	return true
}
开发者ID:ccppluagopy,项目名称:Zebra,代码行数:14,代码来源:handler.go

示例3: handleClientRegist

func handleClientRegist(client *NetCore.Client, msg *NetCore.NetMsg) bool {
	var (
		req ClientRegistReq
	)

	if err := json.Unmarshal([]byte(msg.Buf), &req); err != nil {
		return false
	}

	id := req.Id

	client.CancelWaitRegist()

	msg.Buf = ErrConf.GetEmptyRspBuffer(ErrConf.NO_ERR)
	client.SendMsg(msg)

	NetCore.AddClientToManager(client, NetCore.ClientIDType(id))

	Logger.Info(LogConf.WorkerClientJob, client.Idx, "handleClientRegist client Idx: %d id: %d", client.Idx, id)

	return true
}
开发者ID:cokeboL,项目名称:ZIM,代码行数:22,代码来源:Regist.go

示例4: handleRegist

func handleRegist(client *NetCore.Client, msg *NetCore.NetMsg) bool {
	var ctype = binary.LittleEndian.Uint32(msg.Buf)
	client.CancelWaitRegist()

	if ctype == NetConf.Client {
		binary.LittleEndian.PutUint32(msg.Buf[0:4], NetConf.Worker)
		client.SendMsg(msg)
	} else {
		if client != courier {
			Logger.Warn(LogConf.WorkerServerJob, LogConf.SERVER, "handleServerRegist error, %v %d!", courier, client.Idx)
			return false
		}

		Logger.Info(LogConf.WorkerServerJob, LogConf.SERVER, "handleServerRegist OK, %v %d!", courier, client.Idx)

		NetCore.MarkServer(client, ctype)
	}

	Logger.Info(LogConf.WorkerServerJob, LogConf.SERVER, "handleRegist, type: %d %d!", ctype, client.Idx)

	return true
}
开发者ID:ccppluagopy,项目名称:Zebra,代码行数:22,代码来源:Handlers.go

示例5: handleRegist

func handleRegist(client *NetCore.Client, msg *NetCore.NetMsg) bool {
	client.CancelWaitRegist()
	client.HeartBeat()
	return true
}
开发者ID:ccppluagopy,项目名称:Zebra,代码行数:5,代码来源:main.go


注:本文中的NetCore.Client.CancelWaitRegist方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。