uhst library
Classes
- EventMessage
- Message
- RelaySocket
- UhstSocket is similar to the HTML5 WebSocket interface, but instead of a dedicated server, one peer acts as a host for other peers to join.
- RelaySocketProvider
- UHST
- Provides a way to init Client UhstSocket and UhstHost
- UhstHost
- UhstHost in UHST is a peer which every other peer (UhstSocket) connects to. This concept is similar to listen-server in multiplayer games.
- UhstHostSocket
- UhstRelayClient
- UhstSocket
- UhstSocketProvider
- Provides Client or Host socket depending from received configuration
Enums
- HostEventType
- Defines message types for event streams inside host sockets
- PayloadType
- PayloadType is a type of message data which can be send and handled by Client (for example RelaySocket or by Host UhstHost
- RelayEventType
- Relay(Server) events happened on host or client side As all events are in snake_case they will be converted automatically to camelCase
- UhstSocketEventType
- Defines message types for event streams inside client sockets
Extensions
Typedefs
- CloseHandler = void Function({required String hostId})
- DiagnosticHandler = void Function({required String message})
- ExceptionHandler = void Function({required dynamic exception})
-
FromJson<
T> = T Function(dynamic map) - Defines callback to handle FromJson function This function is needed to convert Map in defined type or model
- HostConnectionHandler = void Function({required UhstSocket uhstSocket})
- HostReadyHandler = void Function({required String hostId})
- MessageHandler = void Function({required String message})
- OpenHandler = void Function()
- RelayEventHandler = void Function({required RelayEvent event})
- RelayExceptionHandler = void Function({required RelayException exception})
- RelayMessageHandler = void Function({required Message message})
- RelayReadyHandler = void Function({required RelayStream stream})