Socket Manager
Socket manager for handling real-time communication with MediaSFU servers.
This interface defines the contract for managing Socket.IO connections, including connection lifecycle, event emission, and event registration.
Usage:
val socketManager: SocketManager = SocketManagerImpl()
// Connect to server
socketManager.connect("https://mediasfu.com", SocketConfig())
// Register event handlers
socketManager.on("message") { data ->
}
// Emit events
socketManager.emit("sendMessage", mapOf("text" to "Hello"))
// Disconnect
socketManager.disconnect()Inheritors
Properties
Functions
Disconnect from the Socket.IO server. Cleans up all event handlers and closes the connection.
Get the current connection state.
Check if currently connected to the server.
Register a handler for disconnection events. Called when the socket disconnects (either intentionally or due to error).
Register a handler for reconnection events. Called when the socket successfully reconnects after a disconnection.
Register a handler for reconnection attempts. Called before each reconnection attempt.
Register a handler for reconnection failures. Called when all reconnection attempts have been exhausted.