Configuring Flash Communication Server > About the configuration files > The Adaptor.xml file

 

The Adaptor.xml file

The Adaptor.xml file defines settings for an adaptor. It determines the number of threads that can be used by the adaptor, the communications ports that adaptor binds to, and the IP addresses or domains from which the adaptor can accept connections.

Each adaptor must have its own directory inside the server's conf directory. The name of the directory is the name of the adaptor. Each adaptor directory must contain an Adaptor.xml file. For example, the default adaptor included with the server at installation is named _defaultRoot_, and its directory is found in the \Flash Communication Server MX\conf\ directory.

To change an adaptor's settings, you edit the tags in the Adaptor.xml file.

The Adaptor.xml file contains the following tag structure, along with brief comments for each tag:

<Adaptor>
	<ResourceLimits>
		<MaxThreads>100</MaxThreads>
	</ResourceLimits>
	<HostPortList>
		<HostPort>:1935</HostPort>
	</HostPortList>
	<Allow></Allow>
	<Deny></Deny>
	<Order>Deny,Allow</Order>
</Adaptor>

The tags in the Adaptor.xml file serve the following purposes:

<Adaptor> contains all the other adaptor configuration tags.

<ResourceLimits> is a container for the <MaxThreads> tag.

<MaxThreads> specifies the maximum number of threads to create on the server for processing input/output requests. The default is 100. Increasing this number allows more threads to run concurrently, but also increases the processor workload by requiring more thread-switching operations. Generally you will not need to change this setting. If you do want to change it, test you applications thoroughly to determine the best value.

<HostPortList> is a container for one or more <HostPort> tags.

<HostPort> specifies the IP address and one or more port numbers for the adaptor to bind to. The IP address and port number are separated by a colon. If you specify more than one port, separate them with commas.

For example, a <HostPort> tag might look like this:

<HostPort>12.34.56.78:1935, 443</HostPort>

You can set up the adaptor to listen on more than one IP address by specifying more than one <HostPort> tag.

By default, Flash Communication Server uses port number 1935 for RTMP connections. You may choose to use other ports. When there is a proxy server or firewall that allows only HTTP content through, the server uses HTTP to transmit RTMP packets (this process is called HTTP tunneling); if a connection through port 1935 fails, the server tries again using HTTP and port 80. To explicitly use HTTP tunneling, you can configure the adaptor to listen on port 80 in the <HostPort> tag. Whichever port you use, be sure it is set to the "open" state. When you change the port number, you must also change it in the client application's ActionScript NetConnection call.

As a security precaution, when you specify an IP address in the <HostPort> tag, the server will not bind to (listen to) localhost. (The term localhost refers to the computer the server is running on.) If you do not specify an address, the server will bind to both localhost and the true IP address of the computer it is running on.

<Allow>, <Deny>, and <Order> serve the same purposes as in the Server.xml file, but indicate permissions specifically for this adaptor. (See The Server.xml file.)

The following set of Adaptor.xml tags has been customized for real-world use. Up to five threads can be created for the adaptor. The adaptor will bind to ports 1935 and 80 and will accept connections from any IP address.

<Adaptor>
	<ResourceLimits>
		<MaxThreads>5</MaxThreads>
	</ResourceLimits>
	<HostPortList>
		<HostPort>12.34.56.78:1935, 80</HostPort>
	</HostPortList>
	<Allow>all</Allow>
	<Deny></Deny>
	<Order>Deny,Allow</Order>
</Adaptor>