1111using Microsoft . Owin ;
1212
1313namespace Microsoft . Azure . SignalR . AspNet ;
14+ #nullable enable
1415
1516/// <summary>
1617/// Configurable options when using Azure SignalR Service.
@@ -20,7 +21,7 @@ public class ServiceOptions : IServiceEndpointOptions
2021 public ServiceOptions ( )
2122 {
2223 var count = ConfigurationManager . ConnectionStrings . Count ;
23- string connectionString = null ;
24+ string ? connectionString = null ;
2425 var endpoints = new List < ServiceEndpoint > ( ) ;
2526 var connectionStringKeyPrefix = $ "{ Constants . Keys . ConnectionStringDefaultKey } :";
2627 for ( var i = 0 ; i < count ; i ++ )
@@ -82,7 +83,7 @@ public ServiceOptions()
8283 /// <summary>
8384 /// Gets or sets the proxy used when ServiceEndpoint will attempt to connect to Azure SignalR.
8485 /// </summary>
85- public IWebProxy Proxy { get ; set ; }
86+ public IWebProxy ? Proxy { get ; set ; }
8687
8788 /// <summary>
8889 /// Specifies the mode for server sticky, when client is always routed to the server which it first /negotiate with, we call it "server sticky mode".
@@ -96,7 +97,14 @@ public ServiceOptions()
9697 /// Gets or sets the func to generate claims from <see cref="IOwinContext" />.
9798 /// The claims will be included in the auto-generated token for clients.
9899 /// </summary>
99- public Func < IOwinContext , IEnumerable < Claim > > ClaimsProvider { get ; set ; } = null ;
100+ public Func < IOwinContext , IEnumerable < Claim > > ? ClaimsProvider { get ; set ; }
101+
102+ /// <summary>
103+ /// Provide the ability to configure the underlying ClientWebSocketOptions for the WebSocketClient used to establish the server connection to the service
104+ /// For example, you could specify the inner buffer used for each WebSocketClient by setting:
105+ /// <code>options.ConfigureServiceConnectionWebSocketOptions = o => o.SetBuffer(0x1000, 0x1000);</code>
106+ /// </summary>
107+ public Action < System . Net . WebSockets . ClientWebSocketOptions > ? ConfigureServiceConnectionWebSocketOptions { get ; set ; }
100108
101109 /// <summary>
102110 /// Gets or sets the initial number of connections per hub from SDK to Azure SignalR Service. Default value is 5.
@@ -114,12 +122,12 @@ public int ConnectionCount
114122 /// <summary>
115123 /// Gets or sets the connection string of Azure SignalR Service instance.
116124 /// </summary>
117- public string ConnectionString { get ; set ; }
125+ public string ? ConnectionString { get ; set ; }
118126 /// <summary>
119127 /// Gets or sets the func to set diagnostic client filter from <see cref="IOwinContext" />.
120128 /// The clients will be regarded as diagnostic client only if the function returns true.
121129 /// </summary>
122- public Func < IOwinContext , bool > DiagnosticClientFilter { get ; set ; } = null ;
130+ public Func < IOwinContext , bool > ? DiagnosticClientFilter { get ; set ; } = null ;
123131
124132 /// <summary>
125133 /// Customize the multiple endpoints used
@@ -145,5 +153,5 @@ public int ConnectionCount
145153 /// <summary>
146154 /// Gets applicationName, which will be used as a prefix to apply to each hub name
147155 /// </summary>
148- internal string ApplicationName { get ; set ; }
156+ internal string ApplicationName { get ; set ; } = string . Empty ;
149157}
0 commit comments