fixes
This commit is contained in:
parent
08b373f0c7
commit
38bf25f42d
|
|
@ -139,7 +139,8 @@ public class DevAdminSignalRHub : Hub<ISignalRHubItemServer>, IAcSignalRHubServe
|
|||
|
||||
public async Task OnReceiveMessage(int messageTag, byte[]? message, int? requestId)
|
||||
{
|
||||
var logText = $"{ConstHelper.NameByValue<SignalRTags>(messageTag)} Server OnReceiveMessage; {nameof(requestId)}: {requestId}; ConnectionId: {Context.ConnectionId}; UserIdentifier: {Context.UserIdentifier}";
|
||||
var tagName = ConstHelper.NameByValue<SignalRTags>(messageTag);
|
||||
var logText = $"Server OnReceiveMessage; {nameof(requestId)}: {requestId}; ConnectionId: {Context.ConnectionId}; {tagName}";
|
||||
|
||||
if (message is { Length: 0 }) _logger.Warning($"message.Length == 0! {logText}");
|
||||
else _logger.Info(logText);
|
||||
|
|
@ -152,11 +153,11 @@ public class DevAdminSignalRHub : Hub<ISignalRHubItemServer>, IAcSignalRHubServe
|
|||
|
||||
object[]? paramValues = null;
|
||||
|
||||
logText = $"{ConstHelper.NameByValue<SignalRTags>(messageTag)} Found dynamic method for the tag! method: {methodsByDeclaringObject.InstanceObject.GetType().Name}.{methodInfoModel.MethodInfo.Name}";
|
||||
logText = $"Found dynamic method for the tag! method: {methodsByDeclaringObject.InstanceObject.GetType().Name}.{methodInfoModel.MethodInfo.Name}";
|
||||
|
||||
if (methodInfoModel.ParamInfos is { Length: > 0 })
|
||||
{
|
||||
_logger.Debug($"{logText}({string.Join(", ", methodInfoModel.ParamInfos.Select(x => x.Name))})");
|
||||
_logger.Debug($"{logText}({string.Join(", ", methodInfoModel.ParamInfos.Select(x => x.Name))}); {tagName}");
|
||||
|
||||
paramValues = new object[methodInfoModel.ParamInfos.Length];
|
||||
|
||||
|
|
@ -208,14 +209,14 @@ public class DevAdminSignalRHub : Hub<ISignalRHubItemServer>, IAcSignalRHubServe
|
|||
}
|
||||
else paramValues[0] = message!.MessagePackTo<SignalPostJsonDataMessage<object>>(MessagePackSerializerOptions.Standard).PostDataJson.JsonTo(firstParamType)!;
|
||||
}
|
||||
else _logger.Debug($"{logText}()");
|
||||
else _logger.Debug($"{logText}(); {tagName}");
|
||||
|
||||
await ResponseToCaller(messageTag, new SignalResponseJsonMessage(SignalResponseStatus.Success, methodInfoModel.MethodInfo.InvokeMethod(methodsByDeclaringObject.InstanceObject, paramValues)), requestId);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
_logger.Debug($"{ConstHelper.NameByValue<SignalRTags>(messageTag)} Not found dynamic method for the tag! tag: {messageTag};");
|
||||
_logger.Debug($"Not found dynamic method for the tag! {tagName}");
|
||||
|
||||
switch (messageTag)
|
||||
{
|
||||
|
|
@ -287,13 +288,13 @@ public class DevAdminSignalRHub : Hub<ISignalRHubItemServer>, IAcSignalRHubServe
|
|||
// return;
|
||||
|
||||
default:
|
||||
_logger.Error($"{ConstHelper.NameByValue<SignalRTags>(messageTag)} Server OnReceiveMessage; messageTag not found!");
|
||||
_logger.Error($"Server OnReceiveMessage; messageTag not found! {tagName}");
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error($"{ConstHelper.NameByValue<SignalRTags>(messageTag)} Server OnReceiveMessage; {ex.Message}", ex);
|
||||
_logger.Error($"Server OnReceiveMessage; {ex.Message}; {tagName}", ex);
|
||||
}
|
||||
|
||||
await ResponseToCaller(messageTag, new SignalResponseJsonMessage(SignalResponseStatus.Error), requestId);
|
||||
|
|
@ -304,7 +305,7 @@ public class DevAdminSignalRHub : Hub<ISignalRHubItemServer>, IAcSignalRHubServe
|
|||
|
||||
protected async Task SendMessageToClient(ISignalRHubItemServer sendTo, int messageTag, ISignalRMessage message, int? requestId = null)
|
||||
{
|
||||
_logger.Info($"{ConstHelper.NameByValue<SignalRTags>(messageTag)} Server SendMessageToClient; {nameof(requestId)}: {requestId}; ConnectionId: {Context.ConnectionId}; UserIdentifier: {Context.UserIdentifier}");
|
||||
_logger.Info($"Server SendMessageToClient; {nameof(requestId)}: {requestId}; ConnectionId: {Context.ConnectionId}; {ConstHelper.NameByValue<SignalRTags>(messageTag)}");
|
||||
|
||||
await sendTo.OnReceiveMessage(messageTag, message.ToMessagePack(ContractlessStandardResolver.Options), requestId);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue