public bool Connect(ClientCrawlerInfo clientCrawlerInfo) { try { var site = new InstanceContext(this); var binding = new NetTcpBinding(SecurityMode.None); //var address = new EndpointAddress("net.tcp://localhost:22222/chatservice/"); var address = new EndpointAddress("net.tcp://193.124.113.235:22222/chatservice/"); var factory = new DuplexChannelFactory<IRemoteCrawler>(site, binding, address); proxy = factory.CreateChannel(); ((IContextChannel)proxy).OperationTimeout = new TimeSpan(1, 0, 10); clientCrawlerInfo.ClientIdentifier = _singletoneId; proxy.Join(clientCrawlerInfo); return true; } catch (Exception ex) { MessageBox.Show("Error happened" + ex.Message); return false; } }
public void AddCrawler(IRemoteCrawler crawler) { crawler.Initialize(this); this._crawlers.Add(crawler); }
public void AddCrawler(IRemoteCrawler crawler) { crawler.Initialize(this); this._crawlers.Add(crawler); }