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:
parent
a120cd65ff
commit
f06bd5004d
|
|
@ -79,11 +79,6 @@ namespace AyCode.Services.SignalRs
|
||||||
HubConnection = null;
|
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)
|
private Task HubConnection_Closed(Exception? arg)
|
||||||
{
|
{
|
||||||
if (_responseByRequestId.IsEmpty) Logger.DebugConditional("Client HubConnection_Closed");
|
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 msgBytes = message != null ? SignalRSerializationHelper.SerializeToBinary(message) : null;
|
||||||
|
|
||||||
var stream = HubConnection.StreamAsync<byte[]>(
|
var stream = HubConnection.StreamAsync<byte[]>(
|
||||||
nameof(IAcSignalRHubBase.OnReceiveStreamMessage),
|
"OnReceiveStreamMessage",
|
||||||
messageTag,
|
messageTag,
|
||||||
msgBytes,
|
msgBytes,
|
||||||
cancellationToken);
|
cancellationToken);
|
||||||
|
|
@ -289,7 +284,7 @@ namespace AyCode.Services.SignalRs
|
||||||
var msgBytes = SignalRSerializationHelper.SerializeToBinary(message);
|
var msgBytes = SignalRSerializationHelper.SerializeToBinary(message);
|
||||||
|
|
||||||
var stream = HubConnection.StreamAsync<byte[]>(
|
var stream = HubConnection.StreamAsync<byte[]>(
|
||||||
nameof(IAcSignalRHubBase.OnReceiveStreamMessage),
|
"OnReceiveStreamMessage",
|
||||||
messageTag,
|
messageTag,
|
||||||
msgBytes,
|
msgBytes,
|
||||||
cancellationToken);
|
cancellationToken);
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,4 @@ public interface IAcSignalRHubBase
|
||||||
{
|
{
|
||||||
//Task OnRequestMessage(int messageTag, int requestId);
|
//Task OnRequestMessage(int messageTag, int requestId);
|
||||||
Task OnReceiveMessage(int messageTag, byte[] messageBytes, int? requestId);
|
Task OnReceiveMessage(int messageTag, byte[] messageBytes, int? requestId);
|
||||||
|
|
||||||
IAsyncEnumerable<byte[]> OnReceiveStreamMessage(int messageTag, byte[]? messageBytes);
|
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue