MCPcopy Index your code
hub / github.com/dearcode/candy / MessageHandler

Interface MessageHandler

client/candy.go:21–33  ·  view source on GitHub ↗

MessageHandler 接收服务器端推送来的消息

Source from the content-addressed store, hash-verified

19
20// MessageHandler 接收服务器端推送来的消息
21type MessageHandler interface {
22 // OnRecv 这函数理论上是多线程调用,客户端需要注意下
23 OnRecv(event int32, operate int32, id int64, group int64, from int64, to int64, body string)
24
25 // OnError 连接被服务器断开,或其它错误
26 OnError(msg string)
27
28 // OnHealth 连接正常
29 OnHealth()
30
31 // OnUnHealth 连接异常
32 OnUnHealth(msg string)
33}
34
35// CandyClient 客户端提供和服务器交互的接口
36type CandyClient struct {

Callers 4

loopRecvMessageMethod · 0.65
loopRecvMessageMethod · 0.65
healthCheckMethod · 0.65
healthCheckMethod · 0.65

Implementers 2

cmdClientcandy.go
cmdClientclient/candy_test.go

Calls

no outgoing calls

Tested by

no test coverage detected