public Actor NewActor(string url, ConnectionStateDelegate d = null) { if (url.StartsWith("http")) { return(new WebActor(url)); } return(new Actor(url, d)); }
static public void RemoveWatcher(string url, ConnectionStateDelegate d) { ConnectionStateDelegate tmp; if (watchers.TryGetValue(url, out tmp)) { tmp -= d; } }
public Actor(string url, ConnectionStateDelegate d = null) { Parse(url); if (d == null) { d = DefaultConnectionWatcher; } _watcher = d; TransportManager.AddWatcher(URL, _watcher); }
static public void AddWatcher(string url, ConnectionStateDelegate d) { ConnectionStateDelegate tmp; if (watchers.TryGetValue(url, out tmp)) { tmp += d; } else { watchers.Add(url, d); } }