This directory contains practical examples demonstrating how to use the Transport Services API for various networking scenarios.
- SimpleClient.swift - Basic TCP-like client connection
- SimpleServer.swift - Basic TCP-like server listener
- UDPExample.swift - Unreliable datagram communication
- RendezvousExample.swift - Peer-to-peer connection with NAT traversal
- ConnectionGroupExample.swift - Managing multiple related connections
- MulticastExample.swift - Multicast sender and receiver
- ZeroRTTExample.swift - 0-RTT connection establishment
- SecurityCallbackExample.swift - Custom certificate validation
- ChatApplication.swift - Simple chat using reliable messages
- FileTransfer.swift - Bulk data transfer with progress
- VideoStreaming.swift - Real-time media streaming
- GameNetworking.swift - Low-latency game networking
Each example is a standalone Swift file that can be run with:
swift run ExampleNameMake sure you have built the Transport Services package first:
swift build- Protocol Selection: How Transport Services automatically selects the best protocol
- Property Configuration: Using pre-configured profiles and custom properties
- Error Handling: Proper handling of network errors and edge cases
- Performance Optimization: Using features like 0-RTT and multipath
- Security: Implementing custom security callbacks and policies