當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。