func getComponentInterface(channelname string) netfw.IComponent { p := netfw.FindPeer(channelname) if p == nil { return nil } com := p.GetComponent(componentName) if com == nil { log.Printf("rpc component not found on channel: %s", channelname) return nil } return com }
// 从sess获取一个可用的绑定信息 func GetInterface(channelname string) IRemoteCall { p := netfw.FindPeer(channelname) if p == nil { log.Printf("channel not found: %s", channelname) return nil } com := p.GetComponent(componentName) if com == nil { log.Printf("rpc component not found on channel: %s", channelname) return nil } return com.(IRemoteCall) }