private async Task ConnectInternal2Async(string input, IBrowserProfile browserProfile) { var(channelName, broadcastId) = Tools.ExtractChannelNameAndLiveId(input); if (string.IsNullOrEmpty(broadcastId)) { return; } var messageProvider = new MessageProvider(new Websocket(), _logger); messageProvider.Received += MessageProvider_Received; var connector = new PeriscopeConnector(_server, broadcastId, messageProvider, _logger); var me = new MessageUntara(); me.SystemInfoReiceved += Me_SystemInfoReiceved; _autoReconnector = new AutoReconnector(connector, me); await _autoReconnector.AutoConnect(); me.SystemInfoReiceved -= Me_SystemInfoReiceved; messageProvider.Received -= MessageProvider_Received; }
private async Task ConnectInternalAsync(string input, IBrowserProfile browserProfile) { var url = Tools.GetUrl(input); if (url is UnknownUrl) { //不正なURL return; } var cc = GetCookieContainer(browserProfile); var messageSetter = new MessageUntara(); messageSetter.SystemInfoReiceved += MessageSetter_SystemInfoReiceved; var p1 = new MessageProvider(_logger); p1.MessageReceived += P1_MessageReceived; p1.MetadataUpdated += P1_MetadataUpdated; //var p2 = new MetadataProvider2(_server, _siteOptions); //p2.MetadataUpdated += P2_MetadataUpdated; //p2.Master = p1; try { var dummy = new DummyImpl(_server, url, browserProfile, _logger, _siteOptions, p1, messageSetter);//, p2); var connectionManager = new ConnectionManager(_logger); _autoReconnector = new TestAutoReconnector(connectionManager, dummy, messageSetter, _logger, url, _server); await _autoReconnector.AutoReconnectAsync(); } finally { messageSetter.SystemInfoReiceved -= MessageSetter_SystemInfoReiceved; p1.MessageReceived -= P1_MessageReceived; p1.MetadataUpdated -= P1_MetadataUpdated; //p2.MetadataUpdated -= P2_MetadataUpdated; } }
public DummyImpl(IDataServer server, IUrl url, IBrowserProfile browserProfile, ILogger logger, IPeriscopeSiteOptions siteOptions, MessageProvider p1, MessageUntara messageSetter) { _server = server; _url = url; _browserProfile = browserProfile; _logger = logger; _siteOptions = siteOptions; _p1 = p1; _messageSetter = messageSetter; //_p2 = p2; }