Skip to content

Commit 617576b

Browse files
committed
Update
1 parent 2cad736 commit 617576b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Transports.AspNetCore/WebSockets/SubscriptionsTransportWs/SubscriptionServer.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,14 @@ protected override Task OnConnectionInitAsync(OperationMessage message, bool sma
126126
/// as this protocol does not support the other modes. Override this method to support your own implementation.
127127
/// </remarks>
128128
protected override Task OnKeepAliveLoopAsync(TimeSpan keepAliveTimeout, KeepAliveMode keepAliveMode)
129-
=> base.OnKeepAliveLoopAsync(
129+
{
130+
if (keepAliveMode == KeepAliveMode.TimeoutWithPayload)
131+
throw new NotSupportedException("The 'subscription-transport-ws' protocol does not support the 'TimeoutWithPayload' keep-alive mode.");
132+
133+
return base.OnKeepAliveLoopAsync(
130134
keepAliveTimeout,
131135
KeepAliveMode.Interval);
136+
}
132137

133138
private static readonly OperationMessage _keepAliveMessage = new() { Type = MessageType.GQL_CONNECTION_KEEP_ALIVE };
134139
/// <inheritdoc/>

0 commit comments

Comments
 (0)