msgbartop
Various ramblings-on, mostly about Red5
msgbarbottom

28 Sep 08 Tomcat connectors

In Red5, you have pretty much full access to manipulate the embedded Tomcat engine via Spring. With that being said I would like to give details on how to change the http connector between two available options; there are several other options, but I’ll only be covering NIO and BIO. First a quick explanation of these two options:

  • BIO – Blocking Input / Output, this has been around since the beginning of internet time. It uses one thread per socket connnection to handle requests.
  • NIO – Non-blocking Input / Output, this has been available in the JDK since 1.4. It uses a single thread to handle many socket connections.
In most cases, you should find NIO to be much faster and more able to handle a lot more connections than BIO will. The default connector was set to NIO until today when I switched it to BIO to prevent problems with Unix-based systems (OSX / Linux).
The configuration of Tomcat in Red5 for HTTP, RTMPT, and RTMPS is nearly identical so you may apply the configuration items below to any of the embedded servers. To configure with a BIO connector, locate the connector section and change the constructor arg value:

<property name=”connector”>
  <bean class=”org.apache.catalina.connector.Connector”>
    <constructor-arg type=”java.lang.String” value=”org.apache.coyote.http11.Http11Protocol” />
    <property name=”port”><value>80</value></property>
    <property name=”redirectPort”><value>443</value></property>
    <property name=”enableLookups”><value>false</value></property>
  </bean>
</property>

To use the NIO connector simply change the constructor arg as shown below:

<property name=”connector”>
  <bean class=”org.apache.catalina.connector.Connector”>
    <constructor-arg type=”java.lang.String” value=”org.apache.coyote.http11.Http11NioProtocol” />
    <property name=”port”><value>80</value></property>
    <property name=”redirectPort”><value>443</value></property>
    <property name=”enableLookups”><value>false</value></property>
  </bean>
</property>

Tags: , , , , , , , ,


Fatal error: Call to undefined function akismet_counter() in C:\xampp\htdocs\paulgregoireblog\wp-content\themes\googlechrome\footer.php on line 9