[*] 资源释放优化
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package com.acgist.taoyao.signal.client;
|
||||
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import com.acgist.taoyao.boot.model.MessageCodeException;
|
||||
|
||||
import lombok.Getter;
|
||||
@@ -55,4 +57,13 @@ public enum ClientType {
|
||||
throw MessageCodeException.of("未知终端类型:" + value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 媒体终端
|
||||
*/
|
||||
public static final ClientType[] MEDIA_CLIENT = Stream.of(ClientType.values()).filter(ClientType::mediaClient).toArray(ClientType[]::new);
|
||||
/**
|
||||
* 媒体服务
|
||||
*/
|
||||
public static final ClientType[] MEDIA_SERVER = Stream.of(ClientType.values()).filter(ClientType::mediaServer).toArray(ClientType[]::new);
|
||||
|
||||
}
|
||||
|
||||
@@ -103,6 +103,7 @@ public class RoomManager {
|
||||
// mediaClient.request(clone);
|
||||
// 更新媒体服务
|
||||
room.setMediaClient(mediaClient);
|
||||
// TODO:通知重建房间
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,8 @@ public class RoomCreateProtocol extends ProtocolClientAdapter implements Applica
|
||||
message.cloneWithoutBody()
|
||||
);
|
||||
message.setBody(room.getRoomStatus());
|
||||
this.clientManager.broadcast(message);
|
||||
// 通知媒体终端
|
||||
this.clientManager.broadcast(message, ClientType.MEDIA_CLIENT);
|
||||
} else {
|
||||
this.logNoAdapter(clientType);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user