pub struct Configuration {
pub simulator_host: String,
pub connect_timeout: Duration,
pub pool_size: usize,
}Expand description
Configuration settings for the RealFlight Link bridge.
The Configuration struct controls how the bridge connects to and communicates with the RealFlight simulator. It provides settings for connection management, timeouts, and performance optimization.
§Connection Pool
The bridge maintains a pool of TCP connections to improve performance when making
frequent SOAP requests. The pool size and connection behavior can be tuned using
the buffer_size, connect_timeout, and retry_delay parameters.
§Default Configuration
The default configuration is suitable for most local development:
use realflight_bridge::Configuration;
use std::time::Duration;
let default_config = Configuration {
simulator_host: "127.0.0.1:18083".to_string(),
connect_timeout: Duration::from_millis(50),
pool_size: 1,
};§Examples
Basic configuration for local development:
use realflight_bridge::Configuration;
use std::time::Duration;
let config = Configuration::default();Configuration optimized for high-frequency control:
use realflight_bridge::Configuration;
use std::time::Duration;
let config = Configuration {
simulator_host: "127.0.0.1:18083".to_string(),
connect_timeout: Duration::from_millis(25), // Faster timeout
pool_size: 5, // Larger connection pool
};Configuration for a different network interface:
use realflight_bridge::Configuration;
use std::time::Duration;
let config = Configuration {
simulator_host: "192.168.1.100:18083".to_string(),
connect_timeout: Duration::from_millis(100), // Longer timeout for network
pool_size: 2,
};Fields§
§simulator_host: StringThe host where the RealFlight simulator is listening for connections.
§Format
The value should be in the format “host:port”. For local development, this is typically “127.0.0.1:18083”.
§Important Notes
- The bridge should run on the same machine as RealFlight for best performance
- Remote connections may experience significant latency due to SOAP overhead
connect_timeout: DurationMaximum time to wait when establishing a new TCP connection.
§Performance Impact
- Lower values improve responsiveness when the simulator is unavailable
- Too low values may cause unnecessary connection failures
- Recommended range: 25-100ms for local connections
§Default
5 milliseconds
pool_size: usizeSize of the connection pool.
The connection pool maintains a set of pre-established TCP connections to improve performance when making frequent requests to the simulator.
§Performance Impact
- Larger values can improve throughput for frequent state updates
- Too large values may waste system resources
- Recommended range: 1-5 connections
§Memory Usage
Each connection in the pool consumes system resources:
- TCP socket
- Memory for connection management
- System file descriptors
§Default
1 connection
Trait Implementations§
Source§impl Clone for Configuration
impl Clone for Configuration
Source§fn clone(&self) -> Configuration
fn clone(&self) -> Configuration
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more