20090312 (Red5 Study 2)

本文详细介绍了Red5服务器的配置方法,包括如何设置webAppRootKey、定义不同作用域及上下文参数等。同时探讨了集成到Tomcat的方式以及RTMPT协议的基本原理。

Standalone server


Should be inside "red5-web.xml" in WEB-INF?


What's the usage of webAppRootKey?
<context-param>
<param-name>webAppRootKey</param-name>
<param-value>/myapp</param-value>
</context-param>


Default scope: The default scope usually has the name web.scope, but the name can be chosen arbitrarily.
<bean id="web.scope" class="org.red5.server.WebScope" init-method="register">
 <property name="server" ref="red5.server" />
 <property name="parent" ref="global.scope" />
 <property name="context" ref="web.context" />
 <property name="handler" ref="web.handler" />
 <property name="contextPath" value="/myapp" />
 <property name="virtualHosts" value="localhost, 127.0.0.1" />
</bean>


Scope refer to context and handler (different from service)


Context: the context bean has the reserved name web.context and is used to map paths to scopes, lookup services and handlers. The default class for this is org.red5.server.Context.
<bean id="web.context" class="org.red5.server.Context" autowire="byType"/>


Handler: every context needs a handler that implements the methods (IScopeHandler) called when a client connects to the scope, leaves it and that contains additional methods that can be called by the client.
<bean id="web.handler" class="org.red5.server.adapter.ApplicationAdapter" singleton="true" />


Integrated in tomcat


"xxx-context.xml" in classpath will be loaded automatically?

What's the usage of globalScope, contextConfigLocation, parentContextKey, log4jConfigLocation?
<context-param>
 <param-name>globalScope</param-name>
 <param-value>default</param-value>
</context-param>
<context-param>
 <param-name>contextConfigLocation</param-name>
 <param-value>WEB-INF/classes/*-web.xml</param-value>
</context-param>
<context-param>
 <param-name>parentContextKey</param-name>
 <param-value>default.context</param-value>
</context-param>
<context-param>
 <param-name>log4jConfigLocation</param-name>
 <param-value>/WEB-INF/log4j.properties</param-value>
</context-param>

References the context listener servlet of the application, this technically takes the place of the Standalone.class in a standard Red5 server
<listener>
<!-- Impersonates a org.springframework.web.context.ContextLoaderListener -->
<listener-class>org.red5.server.MainServlet</listener-class>
</listener>


Every application can only have one context and they should follow this naming convention '<application name>.context' so that they will not conflict with one another?


Multiple language support is achieved by passing a script file name and a list of implemented interface to script factory, so that is can dynamically create a java class which implements IScopeHandler (or maybe some service interface).
<bean id="web.handler" class="org.red5.server.script.groovy.GroovyScriptFactory">
 <constructor-arg index="0" value="classpath:applications/main.groovy"/>
 <constructor-arg index="1">
  <list>
   <value>org.red5.server.api.IScopeHandler</value>
   <value>org.red5.server.adapter.IApplication</value>
  </list>
 </constructor-arg>
</bean>


RTMPT basically is a HTTP wrapper around the RTMP protocol that is sent using POST requests from the client to the server. Because of the non-persistent nature of HTTP connections, RTMPT requires the clients to poll for updates periodically in order to get notified about events that are generated by the server or other clients.
URL should be http://server/<comand>/[<client>/]<index>
Commands: Initial connect (command "open"), Client updates (command "send"), Polling requests (command "idle"), Disconnect of a session (command "close")
Client: specifies the id of the client that performs the requests (only sent for established sessions)
Index: is a consecutive number that seems to be used to detect missing packages
Polling interval: first byte of the response data controls the polling interval of the client, the server always starts with a value of 0x01 after data was returned and increases it after 10 emtpy replies. The maximum delay is 0x21 which causes a delay of approximately 0.5 seconds between two requests.


WebScope scope = (WebScope)appFactory.getBean("web.scope");
scope.setServer(server); // when the server created?
scope.setParent(global); // what about global scope?
scope.register();
scope.start(); // starts a scope? but isn't is starts automatically when a request comes?


"red5.server" and "global.scope" bean?

【事件触发一致性】研究多智能体网络如何通过分布式事件驱动控制实现有限时间内的共识(Matlab代码实现)内容概要:本文围绕多智能体网络中的事件触发一致性问题,研究如何通过分布式事件驱动控制实现有限时间内的共识,并提供了相应的Matlab代码实现方案。文中探讨了事件触发机制在降低通信负担、提升系统效率方面的优势,重点分析了多智能体系统在有限时间收敛的一致性控制策略,涉及系统模型构建、触发条件设计、稳定性与收敛性分析等核心技术环节。此外,文档还展示了该技术在航空航天、电力系统、机器人协同、无人机编队等多个前沿领域的潜在应用,体现了其跨学科的研究价值和工程实用性。; 适合人群:具备一定控制理论基础和Matlab编程能力的研究生、科研人员及从事自动化、智能系统、多智能体协同控制等相关领域的工程技术人员。; 使用场景及目标:①用于理解和实现多智能体系统在有限时间内达成一致的分布式控制方法;②为事件触发控制、分布式优化、协同控制等课题提供算法设计与仿真验证的技术参考;③支撑科研项目开发、学术论文复现及工程原型系统搭建; 阅读建议:建议结合文中提供的Matlab代码进行实践操作,重点关注事件触发条件的设计逻辑与系统收敛性证明之间的关系,同时可延伸至其他应用场景进行二次开发与性能优化。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值