Expand description
TCP server mocking for MockForge
This crate provides TCP server functionality for MockForge, allowing you to mock raw TCP connections for testing purposes.
§Example
use mockforge_tcp::{TcpServer, TcpConfig, TcpSpecRegistry};
use std::sync::Arc;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let config = TcpConfig::default();
let registry = Arc::new(TcpSpecRegistry::new());
let server = TcpServer::new(config, registry)?;
server.start().await?;
Ok(())
}Modules§
- protocol_
server - Unified protocol server lifecycle implementation Unified protocol server implementation for the TCP mock server.
Structs§
- Behavior
Config - Behavior simulation configuration
- Match
Criteria - Criteria for matching incoming TCP data
- TcpConfig
- TCP server configuration
- TcpFixture
- A TCP fixture defining how to handle TCP connections
- TcpResponse
- TCP response configuration
- TcpServer
- TCP server
- TcpSpec
Registry - Registry for TCP fixtures