P2PController

class P2PController(dataSource: P2PDataSource)

Controller for handling P2P (peer-to-peer) messaging and operations.

Constructors

Link copied to clipboard
constructor(dataSource: P2PDataSource)

Functions

Link copied to clipboard
suspend fun disconnect(username: String)

Disconnects a member by closing its WebSocket session.

Link copied to clipboard

Retrieves location messages for the specified user.

Link copied to clipboard
fun onJoin(from: String?, to: String?, sessionId: String, socket: WebSocketSession)

Handles the join event of a P2P member.

Link copied to clipboard
suspend fun sendMessage(fromUserName: String, toUserName: String, message: String = "", latitude: String? = null, longitude: String? = null)

Sends a message to the specified P2P member(s).