Skip to main content

Crate mockforge_tcp

Crate mockforge_tcp 

Source
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§

BehaviorConfig
Behavior simulation configuration
MatchCriteria
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
TcpSpecRegistry
Registry for TCP fixtures