ing
This commit is contained in:
parent
74b55942b9
commit
4c8bb08e99
|
@ -9,9 +9,11 @@ import (
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ServletSocketKey = cuc.ContextKey("ServletSocket")
|
ServletSocketKey = cuc.ContextKey("ServletSocket")
|
||||||
ClientTypeKey = cuc.ContextKey("ClientType")
|
|
||||||
SocketIDKey = cuc.ContextKey("SocketID")
|
GRPCMetadataKey = cuc.ContextKey("GRPCMetadata")
|
||||||
TargetIDKey = cuc.ContextKey("TargetID")
|
ClientTypeKey = cuc.ContextKey("ClientType")
|
||||||
|
SocketIDKey = cuc.ContextKey("SocketID")
|
||||||
|
TargetIDKey = cuc.ContextKey("TargetID")
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -24,11 +24,17 @@ type GatewayRPCServletHandlers struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sh *GatewayRPCServletHandlers) Invoke(servletCTX rpc.ServletContext, requestCodec protocol.RegistryCodec) (result interface{}, err error) {
|
func (sh *GatewayRPCServletHandlers) Invoke(servletCTX rpc.ServletContext, requestCodec protocol.RegistryCodec) (result interface{}, err error) {
|
||||||
md := metadata.Pairs(
|
md := servletCTX.GetAttribute(oogw.GRPCMetadataKey)
|
||||||
oogw.GRPCClientTypeKey, servletCTX.GetAttribute(oogw.SocketIDKey).(string),
|
if nil == md {
|
||||||
oogw.GRPCSessionIDKey, servletCTX.GetAttribute(oogw.SocketIDKey).(string),
|
md = metadata.Pairs(
|
||||||
oogw.GRPCTargetIDKey, servletCTX.GetAttribute(oogw.SocketIDKey).(string))
|
oogw.GRPCClientTypeKey, servletCTX.GetAttribute(oogw.SocketIDKey).(string),
|
||||||
grpcCTX := metadata.NewOutgoingContext(context.Background(), md)
|
oogw.GRPCSessionIDKey, servletCTX.GetAttribute(oogw.SocketIDKey).(string),
|
||||||
|
oogw.GRPCTargetIDKey, servletCTX.GetAttribute(oogw.SocketIDKey).(string))
|
||||||
|
|
||||||
|
servletCTX.SetAttribute(oogw.GRPCMetadataKey, md)
|
||||||
|
}
|
||||||
|
|
||||||
|
grpcCTX := metadata.NewOutgoingContext(context.Background(), md.(metadata.MD))
|
||||||
|
|
||||||
params, err := requestCodec.Params()
|
params, err := requestCodec.Params()
|
||||||
if nil != err {
|
if nil != err {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user