77
88namespace Microsoft . Azure . SignalR . Protocol
99{
10+ public enum OutgoingTaskControlState
11+ {
12+ /// <summary>
13+ /// Send from ASRS to the app server.
14+ /// Asking the client connection to pause sending messages towards ASRS.
15+ /// </summary>
16+ Pause ,
17+
18+ /// <summary>
19+ /// Reply from the app server to ASRS.
20+ /// Ackknowledge that the message sending towards ASRS has been pasued.
21+ /// </summary>
22+ PauseAck ,
23+
24+ /// <summary>
25+ /// Send from ASRS to the app server.
26+ /// Asking the client connection to resume sending messages towards ASRS.
27+ /// </summary>
28+ Resume ,
29+ }
30+
31+ /// <summary>
32+ /// Interface of ack-able message
33+ /// </summary>
34+ public interface IAckableMessage
35+ {
36+ int AckId { get ; set ; }
37+ }
38+
1039 /// <summary>
1140 /// Base class of messages between Azure SignalR Service and SDK.
1241 /// </summary>
@@ -25,8 +54,11 @@ public abstract class ServiceMessage
2554 public abstract class ExtensibleServiceMessage : ServiceMessage
2655 {
2756 private const int TracingId = 1 ;
57+
2858 private const int Ttl = 2 ;
59+
2960 private const int Protocol = 3 ;
61+
3062 private const int Filter = 4 ;
3163 private const int DataMessageType = 5 ;
3264 private const int IsPartial = 6 ;
@@ -156,55 +188,22 @@ internal void ReadExtensionMembers(ref MessagePackReader reader)
156188 }
157189 }
158190
159- /// <summary>
160- /// Interface of ack-able message
161- /// </summary>
162- public interface IAckableMessage
163- {
164- int AckId { get ; set ; }
165- }
166-
167191 /// <summary>
168192 /// The ASRS send it to the source server connection to initiate a client connection migration.
169193 /// Indicates that incoming messages are blocked.
170- /// The app server should block outgoing messages and reply with a <see cref="MigrateConnectionAckMessage"/>.
171194 /// </summary>
172- public class MigrateConnectionRequestMessage : ConnectionMessage
195+ public class OutgoingTaskControlMessage : ConnectionMessage
173196 {
174- /// <summary>
175- ///
176- /// </summary>
177- /// <param name="connectionId">The client connection ID</param>
178- public MigrateConnectionRequestMessage ( string connectionId ) : base ( connectionId )
179- {
180- }
181- }
197+ public OutgoingTaskControlState State { get ; }
182198
183- /// <summary>
184- /// The source server connection send it to the ASRS to confirm the client connection migration.
185- /// Indicates that outgoing messages are being blocked.
186- /// The ASRS should unblock incoming messages and reply with a <see cref="MigrateConnectionFinAckMessage"/>
187- /// </summary>
188- public class MigrateConnectionAckMessage : ConnectionMessage
189- {
190199 /// <summary>
191- ///
200+ ///
192201 /// </summary>
193202 /// <param name="connectionId">The client connection ID</param>
194- public MigrateConnectionAckMessage ( string connectionId ) : base ( connectionId )
195- {
196- }
197- }
198-
199- /// <summary>
200- /// The ASRS send it to the target server connection to complete the client connection migration.
201- /// Indicates that incoming messages are unblocked.
202- /// The target server connection should unblock outgoing messages.
203- /// </summary>
204- public class MigrateConnectionFinAckMessage : ConnectionMessage
205- {
206- public MigrateConnectionFinAckMessage ( string connectionId ) : base ( connectionId )
203+ /// <param name="state">The state of control message</param>
204+ public OutgoingTaskControlMessage ( string connectionId , OutgoingTaskControlState state ) : base ( connectionId )
207205 {
206+ State = state ;
208207 }
209208 }
210209
@@ -220,7 +219,7 @@ public class AccessKeyRequestMessage : ExtensibleServiceMessage
220219
221220 /// <summary>
222221 /// Gets or sets the key Id.
223- /// <c>null</c>
222+ /// <c>null</c>
224223 /// </summary>
225224 public string Kid { get ; set ; }
226225
0 commit comments