func (ri *remoteInfo) SetRemoteAddr(addr net.Addr) bool {
	if ins, ok := ri.instance.(RemoteAddrSetter); ok {
		ri.Lock()
		defer ri.Unlock()
		return ins.SetRemoteAddr(addr)
	}
	return false
}
SetRemoteAddr implements the RemoteAddrSetter interface.
package remoteinfo
import (
	"errors"
	"net"
	"sync"
	"github.com/cloudwego/kitex/internal"
	"github.com/cloudwego/kitex/pkg/discovery"
	"github.com/cloudwego/kitex/pkg/kerrors"
	"github.com/cloudwego/kitex/pkg/rpcinfo"
)
type RemoteInfo interface {
	rpcinfo.EndpointInfo
	SetServiceName(name string)
	SetTag(key, value string) error
	SetTagLock(key string)
	GetInstance() discovery.Instance
	SetInstance(ins discovery.Instance)
	SetRemoteAddr(addr net.Addr) (ok bool)
	ImmutableView() rpcinfo.EndpointInfo
}
type RemoteAddrSetter interface {
	SetRemoteAddr(addr net.Addr) (ok bool)
}
var (
	_              RemoteInfo = &remoteInfo{}
	remoteInfoPool sync.Pool
)
type remoteInfo struct {
	sync.RWMutex
	serviceName string
	method      string
	tags        map[string]string
	instance discovery.Instance
	tagLocks map[string]struct{}
}
func init() {
	remoteInfoPool.New = newRemoteInfo
}
func newRemoteInfo() interface{} {
	return &remoteInfo{
		tags:     make(map[string]string),
		tagLocks: make(map[string]struct{}),
	}
}
func (ri *remoteInfo) GetInstance() (ins discovery.Instance) {
	ri.RLock()
	ins = ri.instance
	ri.RUnlock()
	return
}
func (ri *remoteInfo) SetInstance(ins discovery.Instance) {
	ri.Lock()
	ri.instance = ins
	ri.Unlock()
}
func (ri *remoteInfo) ServiceName() string {
	return ri.serviceName
}
func (ri *remoteInfo) SetServiceName(name string) {
	ri.serviceName = name
}
func (ri *remoteInfo) Method() string {
	return ri.method
}
func (ri *remoteInfo) Tag(key string) (value string, exist bool) {
	ri.RLock()
	defer ri.RUnlock()
	value, exist = ri.tags[key]
	if !exist && ri.instance != nil {
		value, exist = ri.instance.Tag(key)
	}
	return
}
func (ri *remoteInfo) DefaultTag(key, def string) string {
	if value, exist := ri.Tag(key); exist && value != "" {
		return value
	}
	return def
}