//public bool Connected => _client?.Connected ?? false; public TwitchChatConnection(ITwitchChatStreamNotifications notificationReceiver, IFloodPreventer floodPreventer = null, string connectionName = null) { _impl = new ReconnectMiddleware( new RequestCapMiddleware <TwitchChatConnectionParameters>( new ConnectMiddleware( new JoinRateLimiter <Stream>( new PingLoopMiddleware( new ReadLoopMiddleware( new WriteLoopMiddleware( floodPreventer ?? new TwitchFloodPreventer(), new TerminalMiddleware <Stream>() ) ) ) ) ) ) ); _notificationReceiver = notificationReceiver; _connectionName = connectionName ?? Guid.NewGuid().ToString(); }
public WriteLoopMiddleware(IFloodPreventer floodPreventer, IIrcMiddleware <Stream> next) : base(next) { _floodPreventer = floodPreventer; }