Remove client-to-server streaming support in SignalR client

Removed OnReceiveStreamMessage from both AcSignalRClientBase and IAcSignalRHubBase, eliminating client-to-server streaming support. Updated StreamAsync calls to use the explicit method name string. This change enforces server-to-client streaming only and cleans up related interface and method references.
This commit is contained in:
Loretta 2026-04-05 00:30:05 +02:00
parent a120cd65ff
commit f06bd5004d
2 changed files with 2 additions and 9 deletions

View File

@ -79,11 +79,6 @@ namespace AyCode.Services.SignalRs
HubConnection = null;
}
public virtual IAsyncEnumerable<byte[]> OnReceiveStreamMessage(int messageTag, byte[]? messageBytes)
{
throw new NotSupportedException("Client does not support serving streams to the server. Streams are established Server-to-Client only.");
}
private Task HubConnection_Closed(Exception? arg)
{
if (_responseByRequestId.IsEmpty) Logger.DebugConditional("Client HubConnection_Closed");
@ -216,7 +211,7 @@ namespace AyCode.Services.SignalRs
var msgBytes = message != null ? SignalRSerializationHelper.SerializeToBinary(message) : null;
var stream = HubConnection.StreamAsync<byte[]>(
nameof(IAcSignalRHubBase.OnReceiveStreamMessage),
"OnReceiveStreamMessage",
messageTag,
msgBytes,
cancellationToken);
@ -289,7 +284,7 @@ namespace AyCode.Services.SignalRs
var msgBytes = SignalRSerializationHelper.SerializeToBinary(message);
var stream = HubConnection.StreamAsync<byte[]>(
nameof(IAcSignalRHubBase.OnReceiveStreamMessage),
"OnReceiveStreamMessage",
messageTag,
msgBytes,
cancellationToken);

View File

@ -4,6 +4,4 @@ public interface IAcSignalRHubBase
{
//Task OnRequestMessage(int messageTag, int requestId);
Task OnReceiveMessage(int messageTag, byte[] messageBytes, int? requestId);
IAsyncEnumerable<byte[]> OnReceiveStreamMessage(int messageTag, byte[]? messageBytes);
}