ironrdp-blocking provides blocking I/O abstractions that wrap IronRDP state machines, offering a simpler synchronous API for RDP connections when concurrency is not required.
Overview
This crate is a higher-level abstraction for IronRDP state machines using blocking I/O instead of asynchronous I/O. It’s ideal when:- Concurrency is not a requirement
- You prefer simpler synchronous code
- You want fewer dependencies than async alternatives
- You’re working in environments without async runtime support
Core Components
Framed
TheFramed<S> type wraps any stream implementing std::io::Read and std::io::Write, providing buffered RDP protocol frame reading and writing.
Reading Frames
The framed wrapper provides several methods for reading RDP protocol frames: Read Exact Bytes Accumulates and returns exactly the specified number of bytes:Writing Frames
Write complete buffers to the underlying stream:Accessing the Stream
You can access the underlying stream and buffered data:Connection Sequence
The crate provides functions to drive the RDP connection sequence using blocking I/O.Basic Connection Flow
Skipping Initial Phase
If the stream is already at the security upgrade phase:Single Sequence Step
For manual control over the connection sequence:- Reads the next PDU if the connector expects input
- Steps the connector state machine forward
- Writes any response to the stream
Relationship to Core State Machines
ironrdp-blocking wraps the core state machines from ironrdp-connector:
- State machines (
ironrdp-connector::ClientConnector) handle protocol logic - Blocking I/O layer (this crate) handles synchronous network communication
- Framed wrapper manages buffering and frame boundary detection
Error Handling
Most operations returnstd::io::Result<T> or ironrdp_connector::ConnectorResult<T>. Common error scenarios:
- UnexpectedEof: Connection closed before receiving expected data
- Frame parsing errors: Malformed RDP frames
- Protocol errors: Connection sequence violations
When to Use
Useironrdp-blocking when:
- You’re building a simple RDP client without concurrency needs
- You’re working in embedded environments without async support
- You prefer straightforward blocking I/O patterns
- You’re prototyping and want minimal complexity
ironrdp-async with ironrdp-tokio or ironrdp-futures instead.
Dependencies
- ironrdp-connector: Connection state machines
- ironrdp-core: Core RDP types and utilities
- ironrdp-pdu: PDU encoding and decoding
- bytes: Efficient byte buffer management
- tracing: Structured logging
Related Crates
- ironrdp-async - Async I/O abstractions
- ironrdp-connector - Connection state machines
- ironrdp-tls - TLS upgrade helpers

