SwampConnection constructor
Implementation
SwampConnection({
required super.server,
this.roomId,
this.roomCodeEncoder = encodeRoomCode,
this.roomCodeDecoder = decodeRoomCode,
this.e2eePipe,
this.split = kDefaultSwampSplit,
this.flags = const RoomFlags(),
}) : messagePipe = SimpleNetworkerPipe() {
final channelPipe = InternalChannelPipe(bytes: 2, channel: kAnyChannel);
if (e2eePipe != null) {
registerNamedFunction(
SwampEvent.message,
).connect(channelPipe..connect(e2eePipe!..connect(messagePipe)));
} else {
registerNamedFunction(
SwampEvent.message,
).connect(channelPipe..connect(messagePipe));
}
_initFunctions();
}