예제 #1
0
파일: relay.go 프로젝트: chogaths/robin
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
}
예제 #2
0
파일: rpc.go 프로젝트: chogaths/robin
// 从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)
}