【m】优化socket代码

This commit is contained in:
2026-04-29 15:13:24 +08:00
parent 753878bdbb
commit 231021d318
127 changed files with 807 additions and 44137 deletions

View File

@@ -29,6 +29,14 @@ namespace Unity.RenderStreaming
s_AddChannelHandler = Execute;
private static readonly ExecuteEvents.EventFunction<IAddReceiverHandler>
s_AddReceiverHandler = Execute;
private static readonly ExecuteEvents.EventFunction<IParticipantJoinedHandler>
s_ParticipantJoinedHandler = Execute;
private static readonly ExecuteEvents.EventFunction<IParticipantLeftHandler>
s_ParticipantLeftHandler = Execute;
private static readonly ExecuteEvents.EventFunction<ICallRequestHandler>
s_CallRequestHandler = Execute;
private static readonly ExecuteEvents.EventFunction<IMessageHandler>
s_MessageHandler = Execute;
private static void Execute(ICreatedConnectionHandler handler, BaseEventData eventData)
{
@@ -62,6 +70,22 @@ namespace Unity.RenderStreaming
{
handler.OnAddReceiver(ValidateEventData<SignalingEventData>(eventData));
}
private static void Execute(IParticipantJoinedHandler handler, BaseEventData eventData)
{
handler.OnParticipantJoined(ValidateEventData<SignalingEventData>(eventData));
}
private static void Execute(IParticipantLeftHandler handler, BaseEventData eventData)
{
handler.OnParticipantLeft(ValidateEventData<SignalingEventData>(eventData));
}
private static void Execute(ICallRequestHandler handler, BaseEventData eventData)
{
handler.OnCallRequest(ValidateEventData<SignalingEventData>(eventData));
}
private static void Execute(IMessageHandler handler, BaseEventData eventData)
{
handler.OnMessage(ValidateEventData<SignalingEventData>(eventData));
}
public static ExecuteEvents.EventFunction<ICreatedConnectionHandler> createdConnectionHandler
{
@@ -96,6 +120,22 @@ namespace Unity.RenderStreaming
{
get { return s_AddReceiverHandler; }
}
public static ExecuteEvents.EventFunction<IParticipantJoinedHandler> participantJoinedHandler
{
get { return s_ParticipantJoinedHandler; }
}
public static ExecuteEvents.EventFunction<IParticipantLeftHandler> participantLeftHandler
{
get { return s_ParticipantLeftHandler; }
}
public static ExecuteEvents.EventFunction<ICallRequestHandler> callRequestHandler
{
get { return s_CallRequestHandler; }
}
public static ExecuteEvents.EventFunction<IMessageHandler> messageHandler
{
get { return s_MessageHandler; }
}
}