|
|
@ -17,6 +17,7 @@ |
|
|
|
#endregion |
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
|
|
using System; |
|
|
|
using System; |
|
|
|
|
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Threading; |
|
|
|
using System.Threading; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using System.Threading.Tasks; |
|
|
|
|
|
|
|
|
|
|
@ -27,6 +28,8 @@ namespace Grpc.Core |
|
|
|
/// </summary> |
|
|
|
/// </summary> |
|
|
|
public abstract class ServerCallContext |
|
|
|
public abstract class ServerCallContext |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
private Dictionary<object, object> userState; |
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// <summary> |
|
|
|
/// Creates a new instance of <c>ServerCallContext</c>. |
|
|
|
/// Creates a new instance of <c>ServerCallContext</c>. |
|
|
|
/// </summary> |
|
|
|
/// </summary> |
|
|
@ -113,6 +116,12 @@ namespace Grpc.Core |
|
|
|
/// </summary> |
|
|
|
/// </summary> |
|
|
|
public AuthContext AuthContext => AuthContextCore; |
|
|
|
public AuthContext AuthContext => AuthContextCore; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
|
|
|
/// Gets a dictionary that can be used by the various interceptors and handlers of this |
|
|
|
|
|
|
|
/// call to store arbitrary state. |
|
|
|
|
|
|
|
/// </summary> |
|
|
|
|
|
|
|
public IDictionary<object, object> UserState => UserStateCore; |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>Provides implementation of a non-virtual public member.</summary> |
|
|
|
/// <summary>Provides implementation of a non-virtual public member.</summary> |
|
|
|
protected abstract Task WriteResponseHeadersAsyncCore(Metadata responseHeaders); |
|
|
|
protected abstract Task WriteResponseHeadersAsyncCore(Metadata responseHeaders); |
|
|
|
/// <summary>Provides implementation of a non-virtual public member.</summary> |
|
|
|
/// <summary>Provides implementation of a non-virtual public member.</summary> |
|
|
@ -135,7 +144,20 @@ namespace Grpc.Core |
|
|
|
protected abstract Status StatusCore { get; set; } |
|
|
|
protected abstract Status StatusCore { get; set; } |
|
|
|
/// <summary>Provides implementation of a non-virtual public member.</summary> |
|
|
|
/// <summary>Provides implementation of a non-virtual public member.</summary> |
|
|
|
protected abstract WriteOptions WriteOptionsCore { get; set; } |
|
|
|
protected abstract WriteOptions WriteOptionsCore { get; set; } |
|
|
|
/// <summary>Provides implementation of a non-virtual public member.</summary> |
|
|
|
/// <summary>Provides implementation of a non-virtual public member.</summary> |
|
|
|
protected abstract AuthContext AuthContextCore { get; } |
|
|
|
protected abstract AuthContext AuthContextCore { get; } |
|
|
|
|
|
|
|
/// <summary>Provides implementation of a non-virtual public member.</summary> |
|
|
|
|
|
|
|
protected virtual IDictionary<object, object> UserStateCore |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
get |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (userState == null) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
userState = new Dictionary<object, object>(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return userState; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|