(MsgId uint32, data []byte)
| 75 | } |
| 76 | |
| 77 | func (n *notify) NotifyAll(MsgId uint32, data []byte) error { |
| 78 | |
| 79 | n.connIdMap.IterCb(func(key string, v interface{}) { |
| 80 | conn, _ := v.(ziface.IConnection) |
| 81 | err := conn.SendMsg(MsgId, data) |
| 82 | if err != nil { |
| 83 | zlog.Ins().ErrorF("Notify to %s err:%s \n", key, err) |
| 84 | } |
| 85 | }) |
| 86 | |
| 87 | return nil |
| 88 | } |
| 89 | |
| 90 | func (n *notify) NotifyBuffToConnByID(Id uint64, MsgId uint32, data []byte) error { |
| 91 | Conn, err := n.GetNotifyByID(Id) |