Esempio n. 1
0
 /// <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;
     }
 }
Esempio n. 2
0
 /// <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;
         }
     }
 }
Esempio n. 3
0
 /// <summary>
 ///     Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
 /// </summary>
 public void Dispose()
 {
     lock (busyMutex)
         if (refs != 0)
         {
             Logger.LogWarning("XmlRpcClient disposed with " + refs + " refs held");
         }
     lock (client_lock)
     {
         if (client != null)
         {
             client.Dispose();
             client = null;
         }
     }
 }
Esempio n. 4
0
        public bool NegotiateConnection(string xmlrpc_uri)
        {
            int         protos = 0;
            XmlRpcValue tcpros_array = new XmlRpcValue(), protos_array = new XmlRpcValue(), Params = new XmlRpcValue();

            tcpros_array.Set(0, "TCPROS");
            protos_array.Set(protos++, tcpros_array);
            Params.Set(0, this_node.Name);
            Params.Set(1, name);
            Params.Set(2, protos_array);
            string peer_host = "";
            int    peer_port = 0;

            if (!network.splitURI(xmlrpc_uri, ref peer_host, ref peer_port))
            {
                EDB.WriteLine("Bad xml-rpc URI: [" + xmlrpc_uri + "]");
                return(false);
            }
            // test
//			if ( peer_host == "udacity" )
//				peer_host = "192.168.30.111";
            // end test
            XmlRpcClient c = new XmlRpcClient(peer_host, peer_port);

            if (!c.IsConnected || !c.ExecuteNonBlock("requestTopic", Params))
            {
                EDB.WriteLine("Failed to contact publisher [" + peer_host + ":" + peer_port + "] for topic [" + name +
                              "]");
                c.Dispose();
                return(false);
            }
#if DEBUG
            EDB.WriteLine("Began asynchronous xmlrpc connection to http://" + peer_host + ":" + peer_port + "/ for topic [" + name +
                          "]");
#endif
            PendingConnection conn = new PendingConnection(c, this, xmlrpc_uri, Params);
            lock (pending_connections_mutex)
            {
                pending_connections.Add(conn);
            }
            XmlRpcManager.Instance.addAsyncConnection(conn);
            return(true);
        }
Esempio n. 5
0
 public void Dispose()
 {
     client.Dispose();
     client = null;
 }