Ejemplo n.º 1
0
        static SOAClient GetConnection(ServiceInfo si)
        {
            lock (conn_lock) {
                SOAClient cl;
                if (!connections.TryGetValue(si.URI, out cl) || cl.Closed)
                {
                    Uri parsed = new Uri(si.URI);
                    switch (parsed.Scheme)
                    {
                    case "scamp+tls":
                        cl = new SCAMPSOAClient(parsed, si.Certificate);
                        break;

                    default:
                        throw new RPCException("general", "No connection handler available for scheme {0}", parsed.Scheme);
                    }
                    connections [si.URI] = cl;
                }
                return(cl);
            }
        }
Ejemplo n.º 2
0
 static SOAClient GetConnection(ServiceInfo si)
 {
     lock (conn_lock) {
         SOAClient cl;
         if (!connections.TryGetValue (si.URI, out cl) || cl.Closed) {
             Uri parsed = new Uri (si.URI);
             switch (parsed.Scheme) {
             case "scamp+tls":
                 cl = new SCAMPSOAClient (parsed, si.Certificate);
                 break;
             default:
                 throw new RPCException ("general", "No connection handler available for scheme {0}", parsed.Scheme);
             }
             connections [si.URI] = cl;
         }
         return cl;
     }
 }