shsp 1.2.0
shsp: ^1.2.0 copied to clipboard
Single HandShake Protocol (SHSP) - a custom networking protocol for peer-to-peer communication. Unified package containing types, interfaces, and implementations.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[Unreleased] #
1.2.0 - 2026-03-11 #
Added #
- Registry System: New generic registry pattern with mixin-based API for managing multiple instances:
Registry<Key, Value>mixin for key-value based instance managementSingletonclass for type-based instance managementIValueForRegistryinterface for registry-managed objectsRegistryMixintrait for registering and managing sockets/peers
- Extended Interface Support: Socket and peer interfaces now support registry integration:
IShspSocketimplementsIValueForRegistrywithdestroy()methodIShspPeerimplementsIValueForRegistrywith proper cleanup
- Socket Type Enumeration: New
SocketTypeenum for IPv4/IPv6 socket management - Registry Utilities: Helper functions for socket registry initialization and management
Changed #
- Registry Version Preservation: Registry now preserves element version during updates instead of incrementing
register()maintains the existing version when updating an element- New elements are initialized with version 0
- This enables stable version tracking across updates
Fixed #
- Improved resource cleanup with
destroy()methods throughout the API - Better type safety with registry-based instance management
1.0.0 - 2026-03-10 #
Added #
- Initial release of the unified SHSP (Single HandShake Protocol) package
- Core networking protocol implementation for peer-to-peer communication over UDP
ShspSocket: Main UDP socket implementation with callback managementShspPeer: High-level peer abstraction for bidirectional communicationShspInstance: Protocol instance with automatic keep-alive supportShspSocketSingleton: Global socket management with state transfer and reconnection supportAutoShspPeer: Auto-wiring peer that binds toShspSocketSingletonwith automatic reconnectionAutoShspInstance: Auto-wiring instance with automatic socket management- Compression support with three pluggable codecs:
GZipCodec: Best compression ratioLZ4Codec: Fast compression with reasonable ratiosZstdCodec: Balanced compression and speed
- Comprehensive type definitions:
RemoteInfo: Address and port informationSocketProfile: Socket configuration and state trackingInstanceProfile: Instance configuration and state tracking- Callback type definitions for various protocol events
- IPv4 and IPv6 support with automatic address formatting
- Dual-stack socket support for seamless IPv4/IPv6 interoperability
CallbackMapandMessageCallbackMaputilities for managing callbacksAddressUtilityfor address formatting- Complete interface contracts for extensibility
- 399+ comprehensive tests ensuring reliability
- Multi-platform support (Dart CLI, Flutter mobile, web)
- Comprehensive documentation and examples
- GitHub Actions CI/CD pipeline
- LGPL-3.0 license
Features #
- Automatic handshake with configurable timeouts and retry intervals
- Configurable keep-alive heartbeat (default: 30 seconds)
- Non-blocking async/await API throughout
- Singleton pattern for global socket management
- Callback-based message/data reception
- Automatic socket state management and reconnection
- Extensible compression codec interface
- Full type safety with Dart type system