MCPcopy
hub / github.com/lonng/nano / processMessage

Method processMessage

cluster/handler.go:411–429  ·  view source on GitHub ↗
(agent *agent, msg *message.Message)

Source from the content-addressed store, hash-verified

409}
410
411func (h *LocalHandler) processMessage(agent *agent, msg *message.Message) {
412 var lastMid uint64
413 switch msg.Type {
414 case message.Request:
415 lastMid = msg.ID
416 case message.Notify:
417 lastMid = 0
418 default:
419 log.Println("Invalid message type: " + msg.Type.String())
420 return
421 }
422
423 handler, found := h.localHandlers[msg.Route]
424 if !found {
425 h.remoteProcess(agent.session, msg, false)
426 } else {
427 h.localProcess(handler, lastMid, agent.session, msg)
428 }
429}
430
431func (h *LocalHandler) handleWS(conn *websocket.Conn) {
432 c, err := newWSConn(conn)

Callers 1

processPacketMethod · 0.95

Calls 4

remoteProcessMethod · 0.95
localProcessMethod · 0.95
PrintlnMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected