public HastyClient(Uri serverUrl, string realm, string username, string password, CommandDefinitions definitions, string baseDir, object target, ILog log) { this.username = username; this.password = password; this.realm = realm; this.log = log.CreateLog(typeof(HastyClient)); var storage = new StreamStorage(baseDir, log); preferences = new Preferences(baseDir, log); streamStorage = storage; this.definitions = definitions; defaultTarget = target; SetStatus(ConnectionStatus.Idle); SetState(ConnectionState.Establishing); connectionMaintainer = new ConnectionMaintainer(serverUrl, realm, log); connectionMaintainer.OnPacketRead += OnPacketRead; connectionMaintainer.OnDisconnect += OnDisconnect; connectionMaintainer.OnConnecting += OnConnecting; connectionMaintainer.OnConnected += OnMaintainerConnected; ulong userAssignedChannelId; var foundUserAssignedChannel = preferences.GetUserChannel(serverUrl.ToString(), realm, out userAssignedChannelId); if (foundUserAssignedChannel) { Subscribe((uint)userAssignedChannelId, target); } connectionMaintainer.Start(); }
public StreamApiController(IStreamStorage streamStorage) { if (streamStorage == null) { throw new ArgumentNullException("streamStorage"); } this.streamStorage = streamStorage; }
public StreamController(IStreamStorage streamStorage) { if (streamStorage == null) { throw new ArgumentNullException("streamStorage"); } this.streamStorage = streamStorage; }
private StreamController BuildStreamController(IStreamStorage fakeStorage) { return(new StreamController(fakeStorage) { Request = new HttpRequestMessage { Properties = { { HttpPropertyKeys.HttpConfigurationKey, new HttpConfiguration() } } } }); }
public StreamReprocessor(IItemProcessor streamProcessor, IStreamStorage streamStorage) { if (streamProcessor == null) { throw new ArgumentNullException("streamProcessor"); } if (streamStorage == null) { throw new ArgumentNullException("streamStorage"); } this.streamProcessor = streamProcessor; this.streamStorage = streamStorage; }
private StreamController BuildStreamController(IStreamStorage fakeStorage) { return new StreamController(fakeStorage) { Request = new HttpRequestMessage { Properties = { { HttpPropertyKeys.HttpConfigurationKey, new HttpConfiguration() } } } }; }
public void AddStorage(IStreamStorage action) { Storages.Add(action); }