ConnectionManager

lofi_acl.sync.ConnectionManager
class ConnectionManager[MSG](privateIdentity: PrivateIdentity, messageHandler: MessageReceiver[MSG])(using msgCodec: MessageSerialization[MSG])

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def broadcast(msg: MSG*): Boolean
def connectTo(host: String, port: Int): Unit
def connectToExpectingUserIfNoConnectionExists(host: String, port: Int, expectedUser: PublicIdentity): Unit
def connectedUsers: Set[PublicIdentity]
def listenPort: Option[Int]
def send(user: PublicIdentity, msg: MSG): Boolean

Sends a message to the user and returns true, if a connections exists. Otherwise discards message and returns false.

Sends a message to the user and returns true, if a connections exists. Otherwise discards message and returns false.

If the ConnectionManager is shut down, this method also returns false.

Value parameters

msg

The message to send.

user

The user to send the message to.

Attributes

Returns

true if a connections exists, otherwise false.

def sendMultiple(user: PublicIdentity, msgs: MSG*): Boolean
def shutdown(): Unit