//public XmlRpcValue stickaroundyouwench = null; public PendingConnection(XmlRpcClient client, Subscription s, string uri, XmlRpcValue chk) { this.client = client; this.chk = chk; parent = s; RemoteUri = uri; }
public void AddSource(XmlRpcClient source, int eventMask) { addsource(instance, source.instance, (uint) eventMask); }
public void SetSourceEvents(XmlRpcClient source, int eventMask) { setsourceevents(instance, source.instance, (uint)eventMask); }
public void RemoveSource(XmlRpcClient source) { source.SegFault(); removesource(instance, source.instance); }
public void AddSource(XmlRpcClient source, int eventMask) { addsource(instance, source.instance, (uint)eventMask); }
/// <summary> /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// </summary> public void Dispose() { lock (busyMutex) { if (refs != 0) throw new Exception("XmlRpcClient disposed while in use!"); } if (client != null) { client.Dispose(); client = null; } }
private CachedXmlRpcClient(XmlRpcClient c) { client = c; }
public XmlRpcClient getXMLRPCClient(string host, int port, string uri) { XmlRpcClient c = null; lock (clients_mutex) { List<CachedXmlRpcClient> zombies = new List<CachedXmlRpcClient>(); foreach (CachedXmlRpcClient client in clients) { if (!client.in_use) { if (client.client.Host == host && client.client.Port == port && client.client.Uri == uri) { c = client.client; client.in_use = true; client.last_use_time = DateTime.Now; break; } else if (DateTime.Now.Subtract(client.last_use_time).TotalSeconds > 30 || !client.client.IsConnected) { client.client.Shutdown(); zombies.Add(client); } } } clients = clients.Except(zombies).ToList(); } if (c == null) { c = new XmlRpcClient(host, port, uri); clients.Add(new CachedXmlRpcClient(c) {in_use = true, last_use_time = DateTime.Now}); } return c; }
private CachedXmlRpcClient(XmlRpcClient c) { lock (client_lock) { client = c; client.Disposed += () => { client = null; }; } }
/// <summary> /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// </summary> public void Dispose() { lock (busyMutex) if (refs != 0) EDB.WriteLine("warning: XmlRpcClient disposed with "+refs+" refs held"); lock (client_lock) { if (client != null) { client.Dispose(); client = null; } } }
//public XmlRpcValue stickaroundyouwench = null; public PendingConnection(XmlRpcClient client, string uri) { this.client = client; RemoteUri = uri; }
public CachedXmlRpcClient(XmlRpcClient c) { client = c; }
public void releaseXMLRPCClient(XmlRpcClient client) { lock (clients_mutex) { foreach (CachedXmlRpcClient c in clients) { if (client == c.client) { c.in_use = false; break; } } } }
public void Dispose() { chk = null; //.Dispose(); client.Dispose(); client = null; }
public void SetSourceEvents(XmlRpcClient source, int eventMask) { setsourceevents(instance, source.instance, (uint) eventMask); }
public XmlRpcClient getXMLRPCClient(string host, int port, string uri) { XmlRpcClient c = null; lock (clients_mutex) { List<CachedXmlRpcClient> zombies = new List<CachedXmlRpcClient>(); foreach (CachedXmlRpcClient client in clients) { if (!client.in_use) { if (DateTime.Now.Subtract(client.last_use_time).TotalSeconds > 30 || !client.client.IsConnected) { client.client.Shutdown(); zombies.Add(client); } else if (client.client.CheckIdentity(host, port, uri)) { c = client.client; client.in_use = true; client.last_use_time = DateTime.Now; break; } } } foreach (CachedXmlRpcClient C in zombies) { clients.Remove(C); C.client.Dispose(); } if (c == null) { c = new XmlRpcClient(host, port, uri); clients.Add(new CachedXmlRpcClient(c) {in_use = true, last_use_time = DateTime.Now}); } } return c; }