public void Run() { try { Hashtable tcpOptions = new Hashtable(); tcpOptions ["port"] = 0; tcpOptions ["bindTo"] = "127.0.0.1"; tcp = new TcpChannel(tcpOptions, null, null); Hashtable options = new Hashtable(); options ["timeout"] = 10000; // 10s http = new HttpClientChannel(options, null); ChannelServices.RegisterChannel(tcp); ChannelServices.RegisterChannel(http); AppDomain domain = BaseCallTest.CreateDomain("testdomain_activation"); server = (ActivationServer)domain.CreateInstanceAndUnwrap(GetType().Assembly.FullName, "MonoTests.Remoting.ActivationServer"); var tcpUrlPrefix = $"tcp://127.0.0.1:{server.TcpPort}"; var httpUrlPrefix = $"http://127.0.0.1:{server.HttpPort}"; RemotingConfiguration.RegisterActivatedClientType(typeof(CaObject1), tcpUrlPrefix); RemotingConfiguration.RegisterActivatedClientType(typeof(CaObject2), httpUrlPrefix); RemotingConfiguration.RegisterWellKnownClientType(typeof(WkObjectSinglecall1), tcpUrlPrefix + "/wkoSingleCall1"); RemotingConfiguration.RegisterWellKnownClientType(typeof(WkObjectSingleton1), tcpUrlPrefix + "/wkoSingleton1"); RemotingConfiguration.RegisterWellKnownClientType(typeof(WkObjectSinglecall2), httpUrlPrefix + "/wkoSingleCall2"); RemotingConfiguration.RegisterWellKnownClientType(typeof(WkObjectSingleton2), httpUrlPrefix + "/wkoSingleton2"); } catch (Exception ex) { Console.WriteLine(ex); } }
public static void Main(string[] args) { // Create the channel. HttpClientChannel clientChannel = null; string overload = args[0]; if (overload == "1") { clientChannel = Ctor1(); } else if (overload == "2") { clientChannel = Ctor2(); } else { throw new Exception("Argument " + args[0] + "was invalid."); } // Register the channel and the client. Register(clientChannel); // Create an instance of the remote object. RemoteObject service = new RemoteObject(); // Invoke a method on the remote object. InvokeRemoteObject(service); }
public override MConnector Connect(String url, System.Collections.Specialized.NameValueCollection properties) { String[] parts = StripUrl(url); String formatter = parts[2]; String objectUri = parts[3]; String objectUrl = null; HttpClientChannel channel = new HttpClientChannel(); try { ChannelServices.RegisterChannel(channel); } catch (RemotingException) { // Already registered } objectUrl = String.Format("{0}://{1}:{2}/{3}", "http", GetHost(properties), GetPort(properties), objectUri); object ret = RemotingServices.Connect(typeof(MServer), objectUrl, null); return(new MConnector((MServer)ret, channel)); }
public void Run() { try { tcp = new TcpChannel(0); Hashtable options = new Hashtable(); options ["timeout"] = 10000; // 10s http = new HttpClientChannel(options, null); ChannelServices.RegisterChannel(tcp); ChannelServices.RegisterChannel(http); AppDomain domain = BaseCallTest.CreateDomain("testdomain_activation"); server = (ActivationServer)domain.CreateInstanceAndUnwrap(GetType().Assembly.FullName, "MonoTests.Remoting.ActivationServer"); RemotingConfiguration.RegisterActivatedClientType(typeof(CaObject1), "tcp://localhost:9433"); RemotingConfiguration.RegisterActivatedClientType(typeof(CaObject2), "http://localhost:9434"); RemotingConfiguration.RegisterWellKnownClientType(typeof(WkObjectSinglecall1), "tcp://localhost:9433/wkoSingleCall1"); RemotingConfiguration.RegisterWellKnownClientType(typeof(WkObjectSingleton1), "tcp://localhost:9433/wkoSingleton1"); RemotingConfiguration.RegisterWellKnownClientType(typeof(WkObjectSinglecall2), "http://localhost:9434/wkoSingleCall2"); RemotingConfiguration.RegisterWellKnownClientType(typeof(WkObjectSingleton2), "http://localhost:9434/wkoSingleton2"); } catch (Exception ex) { Console.WriteLine(ex); } }
void Application_Start(object sender, EventArgs e) { // Code that runs on application startup // server registration using http IDictionary properties = new Hashtable(); properties["machineName"] = Properties.Settings.Default.hMailServerWebAdminMachineName; HttpServerChannel channel = new HttpServerChannel(properties, null); ChannelServices.RegisterChannel(channel, false); LifetimeServices.LeaseTime = TimeSpan.FromMinutes(10); LifetimeServices.RenewOnCallTime = TimeSpan.FromMinutes(15); RemotingConfiguration.RegisterWellKnownServiceType(new WellKnownServiceTypeEntry( typeof(hMailServerNetRemote.ClassFactory), "Remote.soap", WellKnownObjectMode.SingleCall )); // client registration (for calling a server) using http BinaryClientFormatterSinkProvider clnt = new BinaryClientFormatterSinkProvider(); HttpClientChannel client = new HttpClientChannel((IDictionary)null, clnt); ChannelServices.RegisterChannel(client, false); }
private void button1_Click_1(object sender, EventArgs e) { string adres = textBox1.Text; adres = "http://" + adres; int port = Convert.ToInt32(textBox2.Text); HttpClientChannel kanal = null; try { kanal = new HttpClientChannel(); ChannelServices.RegisterChannel(kanal, false); ZdalnyObiekt obiekt = (ZdalnyObiekt)Activator.GetObject(typeof(ZdalnyObiekt), adres + ":" + port.ToString() + "/NazwaUslugiProjektu"); listBox1.Items.Add(obiekt.ZwrocTekst(textBox3.Text, textBox4.Text)); ChannelServices.UnregisterChannel(kanal); listBox1.Items.Add("polaczenie zostalo zakonczone"); } catch (Exception ext) { MessageBox.Show(ext.Message, "blad"); listBox1.Items.Add("blad polaczenia"); ChannelServices.UnregisterChannel(kanal); } }
private void button1_Click(object sender, EventArgs e) { string address = textBox1.Text; if (!address.StartsWith("http://")) { address = "http://" + textBox1.Text; } int port = (int)numericUpDown1.Value; HttpClientChannel channel = null; try { channel = new HttpClientChannel(); ChannelServices.RegisterChannel(channel, false); RemotingObject remotingObject = (RemotingObject)Activator.GetObject(typeof(RemotingObject), address + ":" + port.ToString() + "/Remoting"); listBox1.Items.Add("Połączenie: " + address + ":" + port.ToString() + "/Remoting"); listBox1.Items.Add(remotingObject.Test()); ChannelServices.UnregisterChannel(channel); listBox1.Items.Add("Połączenie zakończone"); } catch (Exception ex) { MessageBox.Show(ex.Message, "Błąd"); listBox1.Items.Add("Połączenie przerwane"); ChannelServices.UnregisterChannel(channel); } }
static void Main(string[] args) { CookieContainer cookieContainer = new CookieContainer(); using (HttpClient client = new HttpClient("http://localhost:44857/")) { HttpClientChannel clientChannel = new HttpClientChannel(); clientChannel.CookieContainer = cookieContainer; client.Channel = clientChannel; HttpContent loginData = new FormUrlEncodedContent( new List <KeyValuePair <string, string> > { new KeyValuePair <string, string>("Username", "foo"), new KeyValuePair <string, string>("Password", "bar") } ); client.Post("login", loginData); } string result = string.Empty; using (HttpClient client = new HttpClient("http://localhost:44857/contact/")) { HttpClientChannel clientChannel = new HttpClientChannel(); clientChannel.CookieContainer = cookieContainer; client.Channel = clientChannel; client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); HttpResponseMessage response = client.Get("1"); result = response.Content.ReadAsString(); } JavaScriptSerializer jsonDeserializer = new JavaScriptSerializer(); ContactDto contact = jsonDeserializer.Deserialize <ContactDto>(result); Console.WriteLine(contact.Name); Console.ReadLine(); }
public static void PrepareGetService() { var clientChannel = new HttpClientChannel(); ChannelServices.RegisterChannel(clientChannel, false); RemotingConfiguration.CustomErrorsMode = CustomErrorsModes.Off; }
public ConfigurationWizard() { InitializeComponent(); pastPanels = new ArrayList(); pastPanels.Add(mainPanel); currentPanel = mainPanel; HttpClientChannel chan = new HttpClientChannel(); ChannelServices.RegisterChannel(chan, false); }
//setup HTTP client channel public void InitializeClientChannel(string name, bool enableSecurity) { RemotingUtils.RemoveChannel(name); var sinkProvider = new BinaryClientFormatterSinkProvider(); var channel = new HttpClientChannel(name, sinkProvider); ChannelServices.RegisterChannel(channel, enableSecurity); }
public static void Main(string[] args) { // Create the channel. HttpClientChannel clientChannel = new HttpClientChannel(); // Register the channel. ChannelServices.RegisterChannel(clientChannel); // Register as client for remote object. WellKnownClientTypeEntry remoteType = new WellKnownClientTypeEntry(typeof(RemoteObject), "http://localhost:9090/RemoteObject.rem"); RemotingConfiguration.RegisterWellKnownClientType(remoteType); // Create a message sink. string objectUri; System.Runtime.Remoting.Messaging.IMessageSink messageSink = clientChannel.CreateMessageSink( "http://localhost:9090/RemoteObject.rem", null, out objectUri); Console.WriteLine( "The URI of the message sink is {0}.", objectUri); if (messageSink != null) { Console.WriteLine("The type of the message sink is {0}.", messageSink.GetType().ToString()); } // Display the channel's properties using Keys and Item. foreach (string key in clientChannel.Keys) { Console.WriteLine( "clientChannel[{0}] = <{1}>", key, clientChannel[key]); } // Parse the channel's URI. string objectUrl = "http://localhost:9090/RemoteObject.rem"; string channelUri = clientChannel.Parse(objectUrl, out objectUri); Console.WriteLine("The object URL is {0}.", objectUrl); Console.WriteLine("The object URI is {0}.", objectUri); Console.WriteLine("The channel URI is {0}.", channelUri); // Create an instance of the remote object. RemoteObject service = new RemoteObject(); // Invoke a method on the remote object. Console.WriteLine("The client is invoking the remote object."); Console.WriteLine("The remote object has been called {0} times.", service.GetCount()); }
private bool Connect() { HttpClientChannel chan = new HttpClientChannel(); ChannelServices.RegisterChannel(chan, false); Console.Error.WriteLine("Connecting to PractiSES server ({0})...", host); server = (IServer)Activator.GetObject(typeof(IServer), "http://" + host + "/PractiSES"); return(true); }
public RestClient(string endpoint, X509Certificate2 certificate, IEnumerable <Observer> observers = null, CancellationToken token = default) { sendChannel = ChannelFactory.Create(endpoint, certificate) as HttpClientChannel; if (observers != null) { receiveChannel = ChannelFactory.Create(endpoint, certificate, observers, token); Task receiveTask = receiveChannel.ReceiveAsync(); Task.WhenAll(receiveTask); } }
static void Register(HttpClientChannel channel) { // Register the channel. ChannelServices.RegisterChannel(channel); // Register as client for remote object. WellKnownClientTypeEntry remoteType = new WellKnownClientTypeEntry( typeof(RemoteObject), "http://localhost:9090/RemoteObject.rem"); RemotingConfiguration.RegisterWellKnownClientType(remoteType); }
private static HttpClientChannel Ctor2() { //<snippet22> // Create a client channel. string name = "RemotingClient"; IClientChannelSinkProvider sinkProvider = null; HttpClientChannel clientChannel = new HttpClientChannel(name, sinkProvider); //</snippet22> return(clientChannel); }
public MainWindow() { InitializeComponent(); gridLogin.Visibility = Visibility.Visible; ClearAll(); gridClientPanel.Visibility = Visibility.Hidden; HttpClientChannel channel = new HttpClientChannel(); ChannelServices.RegisterChannel(channel, false); RemotingConfiguration.RegisterWellKnownClientType(typeof(BankLogic), "http://localhost:12345/Bank"); bank = new BankLogic(); }
static void Main () { HttpClientChannel channel = new HttpClientChannel (); #if NET_2_0 ChannelServices.RegisterChannel (channel, false); #else ChannelServices.RegisterChannel (channel); #endif IRemoteInterfaceFactory factory = (IRemoteInterfaceFactory) Activator.GetObject (typeof (IRemoteInterfaceFactory), "http://localhost:8000/RemoteInterfaceFactory.soap"); factory.Create (); }
static void Main () { SoapClientFormatterSinkProvider ccsp = new SoapClientFormatterSinkProvider (); HttpClientChannel channel = new HttpClientChannel ((IDictionary) null, ccsp); #if NET_2_0 ChannelServices.RegisterChannel (channel, false); #else ChannelServices.RegisterChannel (channel); #endif IServer server = (IServer) Activator.GetObject (typeof (IServer), "http://127.0.0.1:8080/Server.rem"); ISession session = server.LogOn ("Test"); SessionContext ctx = (SessionContext) CallContext.GetData ("session_ctx"); Assert.AreSame (session, ctx.Session, "#1"); Assert.AreEqual ("Session here", session.GetName (), "#2"); }
private static HttpClientChannel Ctor1() { //<snippet21> // Create a client channel. System.Collections.Hashtable properties = new System.Collections.Hashtable(); properties["port"] = 9090; IClientChannelSinkProvider sinkProvider = null; HttpClientChannel clientChannel = new HttpClientChannel( properties, sinkProvider); //</snippet21> return(clientChannel); }
public static void Main() { try { // <Snippet5> // Creating the 'IDictionary' to set the server object properties. IDictionary myDictionary = new Hashtable(); myDictionary["name"] = "HttpClientChannel"; myDictionary["priority"] = 2; // Set the properties along with the constructor. HttpClientChannel myHttpClientChannel = new HttpClientChannel(myDictionary, new BinaryClientFormatterSinkProvider()); // Register the server channel. ChannelServices.RegisterChannel(myHttpClientChannel); MyHelloServer myHelloServer1 = (MyHelloServer)Activator.GetObject( typeof(MyHelloServer), "http://localhost:8085/SayHello"); if (myHelloServer1 == null) { System.Console.WriteLine("Could not locate server"); } else { Console.WriteLine(myHelloServer1.myHelloMethod("Client")); // Get the name of the channel. Console.WriteLine("Channel Name :" + myHttpClientChannel.ChannelName); // Get the channel priority. Console.WriteLine("ChannelPriority :" + myHttpClientChannel.ChannelPriority.ToString()); string myString, myObjectURI1; Console.WriteLine("Parse :" + myHttpClientChannel.Parse("http://localhost:8085/SayHello", out myString) + myString); // Get the key count. System.Console.WriteLine("Keys.Count : " + myHttpClientChannel.Keys.Count); // Get the channel message sink that delivers message to the specified url. IMessageSink myIMessageSink = myHttpClientChannel.CreateMessageSink("http://localhost:8085/NewEndPoint", null, out myObjectURI1); Console.WriteLine("The channel message sink that delivers the messages to the URL is : " + myIMessageSink.ToString()); Console.WriteLine("URI of the new channel message sink is: " + myObjectURI1); } // </Snippet5> } catch (Exception ex) { Console.WriteLine("The following exception is raised on client side :" + ex.Message); } }
[Category("NotWorking")] // disabled as it got not working by NUnit upgrade to 2.4.8 public void MultiClientConnection() { int num_clients = 20; Hashtable options = new Hashtable(); options ["timeout"] = 10000; // 10s options ["name"] = "MultiClientConnection"; // 10s HttpClientChannel clientChannel = new HttpClientChannel(options, null); ChannelServices.RegisterChannel(clientChannel); try { WellKnownClientTypeEntry remoteType = new WellKnownClientTypeEntry( typeof(RemoteObject), "http://127.0.0.1:9090/RemoteObject.rem"); RemotingConfiguration.RegisterWellKnownClientType(remoteType); // start a bunch of clients... Thread [] clients = new Thread [num_clients]; retvals = new bool [num_clients]; lock (mutex) { for (int i = 0; i < num_clients; i++) { clients[i] = new Thread(MultiClientStart); clients[i].Start(); retvals[i] = false; } } // wait for all clients to finish... for (int i = 0; i < num_clients; i++) { clients[i].Join(); } for (int i = 0; i < num_clients; i++) { Assert.IsTrue(retvals[i], "RemoteObject.Incrememnt() didn't return a value of " + i); } } finally { ChannelServices.UnregisterChannel(clientChannel); } }
static void Main(string[] args) { HttpClientChannel httpChannel = new HttpClientChannel(); ChannelServices.RegisterChannel(httpChannel); WellKnownClientTypeEntry remoteType = new WellKnownClientTypeEntry(typeof(Library.Catalog), "http://localhost:12345/Catalog.rem"); RemotingConfiguration.RegisterWellKnownClientType(remoteType); Catalog catalog = new Catalog(); int id_materie1 = catalog.adaugaMaterie("sd"); int id_materie2 = catalog.adaugaMaterie("asc"); int id_materie3 = catalog.adaugaMaterie("pl"); int id_student1 = catalog.adaugaStudent("mircea dobreanu", "1307b"); int id_student2 = catalog.adaugaStudent("andrei covas", "1307b"); int id_student3 = catalog.adaugaStudent("anonimus", "1310a"); catalog.adaugaNota(3, id_student1, id_materie1); catalog.adaugaNota(2, id_student1, id_materie2); catalog.adaugaNota(1, id_student1, id_materie3); catalog.adaugaNota(10, id_student2, id_materie1); catalog.adaugaNota(9, id_student2, id_materie2); catalog.adaugaNota(8, id_student2, id_materie3); catalog.adaugaNota(5, id_student3, id_materie1); catalog.adaugaNota(4, id_student3, id_materie2); catalog.adaugaNota(3, id_student3, id_materie3); Console.WriteLine("grupa 1307b"); foreach (string student in catalog.returneazaStudenti("1307b")) { Console.WriteLine(student); } foreach (Nota nota in catalog.returneazaNote(id_materie2)) { Console.WriteLine(nota.ToString()); } //RemotingConfiguration.Configure("Client.exe.config"); //RemotingConfiguration.RegisterWellKnownClientType(typeof(Library.Catalog), "http://localhost:12345/Catalog.rem"); }
static void Main(string[] args) { HttpClientChannel channel = new HttpClientChannel(); ChannelServices.RegisterChannel(channel); RemoteObj obj = (RemoteObj)Activator.GetObject(typeof(RemoteObj), "http://localhost:5555/tienhai"); if (obj.checkLogin("abc", "123")) { Console.WriteLine("OK"); } else { Console.WriteLine("Bay r"); } Console.ReadLine(); }
/// <summary> /// 监听Http信道 /// </summary> /// <param name="port">端口</param> /// <param name="channelName">信道名称</param> public void ListenHttpChannel(string channelName, FormatterSinkProviderType fspt = FormatterSinkProviderType.Binary) { IDictionary props = new Hashtable(); props["port"] = 0; props["name"] = channelName; IClientChannelSinkProvider cckp = sinkBinaryProvider; if (fspt == FormatterSinkProviderType.Soap) { cckp = sinkSoapProvider; } HttpClientChannel srvChannel = new HttpClientChannel(props, cckp); ChannelServices.RegisterChannel(srvChannel, false); httpChannels.Add(channelName); }
public void Start() { StartCalled = true; string AppPath = ACA.LabelX.GlobalDataStore.AppPath; // System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location); string RemotingConfigFilePath = AppPath + @"\ACALabelXClient.config.xml"; if (!File.Exists(RemotingConfigFilePath)) { throw new LabelXClientEngineException(string.Format("Remoting configuration file doesn't exist: {0}", RemotingConfigFilePath)); } string Protocol; string Address; string Port; string Uri; Toolbox.Toolbox toolbox = new Toolbox.Toolbox(); toolbox.GetRemotingClientConfiguraton(RemotingConfigFilePath, out Protocol, out Address, out Port, out Uri); Hashtable myTable = new Hashtable(); switch (Protocol.ToLower()) { case "http": myTable["name"] = "servercon"; HttpClientChannel theHttp = new HttpClientChannel(myTable, null); ChannelServices.RegisterChannel(theHttp, false); break; case "tcp": myTable["name"] = "servercon"; TcpClientChannel theTcp = new TcpClientChannel(myTable, null); ChannelServices.RegisterChannel(theTcp, false); break; default: throw new LabelXClientEngineException(string.Format("Cannot obtain the correct protocol from the Remoting configuration file: {0}\r\nProtocol found: {1}\r\nShould be: http, or tcp", RemotingConfigFilePath, Protocol)); } ServerURL = string.Format("{0}://{1}:{2}/{3}", Protocol, Address, Port, Uri); PrintGroups = new List <LabelX.Toolbox.PrintGroupItem>(); toolbox.GetGeneralClientConfiguraton(AppPath + @"\ACALabelXClient.config.xml", out PrintJobsRootFolder, out LabelDefinitionsRootFolder, out PaperDefinitionsRootFolder, out SettingsRootFolder, out PicturesRootFolder, out UpdateRootFolder, out MachineName, out PollFrequency, ref PrintGroups); }
private void button4_Click(object sender, EventArgs e) { try { button4.Enabled = false; Application.DoEvents(); _server = null; ChannelServices.UnregisterChannel(_cnl); _cnl = null; button3.Enabled = true; } catch (Exception ex) { CommonLib.HandleException(ex); button3.Enabled = false; button4.Enabled = true; } }
public void TestReceiveInvalidResponse(string response) { var innerChannel = new TestClientChannel(); var httpChannel = new HttpClientChannel(innerChannel, logger); int i = 0; httpChannel.ResponseReceived += delegate(object sender, DataEventArgs e) { ++i; Assert.IsNotType <HttpData>(e.Data); }; Assert.Equal(0, i); IDataStream stream = new ByteArray(ASCIIEncoding.ASCII.GetBytes(response)); innerChannel.Receive(stream); innerChannel.Close(); Assert.Equal(1, i); }
static void Main(string[] args) { HttpClientChannel serverChannel = new HttpClientChannel(); ChannelServices.RegisterChannel(serverChannel, false); for (int i = 0; i < 5; i++) { ICountingService countingService = (ICountingService)Activator.GetObject(typeof(ICountingService), "http://localhost:8234/CountingService.rem"); int newValue = countingService.Increment(); Console.WriteLine("Value is " + newValue); } Console.WriteLine("Press enter to exit."); Console.ReadLine(); }
static void Main(string[] args) { Console.WriteLine("启动IPC客户端,回车生成远程代理"); //IDictionary props = new Hashtable(); //props["name"] = "IpcClient"; //BinaryClientFormatterSinkProvider bProvider = new BinaryClientFormatterSinkProvider(); //IpcClientChannel channel = new IpcClientChannel(props, bProvider); //ChannelServices.RegisterChannel(channel, false); //FileService fs = Activator.GetObject(typeof(FileService), "ipc://TestChannel/FileService") as FileService; //string content = fs.GetFileName(); //Console.WriteLine(content); //IDictionary props = new Hashtable(); //props["name"] = "IpcClient"; //BinaryClientFormatterSinkProvider bProvider = new BinaryClientFormatterSinkProvider(); //IpcClientChannel channel = new IpcClientChannel(props, bProvider); //ChannelServices.RegisterChannel(channel, false); //IDBMgr sss = Activator.GetObject(typeof(IDBMgr), "ipc://dbChannel/DBMgr") as IDBMgr; //List<MServiceInfo> s = sss.GetServices(); //string content = fs.GetFileName(); Hashtable props = new Hashtable(); props["name"] = "httpClient"; BinaryClientFormatterSinkProvider client = new BinaryClientFormatterSinkProvider(); HttpClientChannel http = new HttpClientChannel(props, client); ChannelServices.RegisterChannel(http, false); IFileMgr fileMgr = Activator.GetObject(typeof(IFileMgr), "http://localhost:31000/FileMgr") as IFileMgr; string test = fileMgr.Test(); for (int i = 0; i < ChannelServices.RegisteredChannels.Length; i++) { (ChannelServices.RegisteredChannels[i] as HttpChannel).StopListening(null); ChannelServices.UnregisterChannel(ChannelServices.RegisteredChannels[i]); } Console.Read(); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); // Creamos el canal para el cliente HttpClientChannel channel = new HttpClientChannel(); // Registramos el canal ChannelServices.RegisterChannel(channel, false); // Registramos el objeto remoto del servidor WellKnownClientTypeEntry remote = new WellKnownClientTypeEntry(typeof(objeto_op.operaciones), "http://localhost:9090/Operaciones"); RemotingConfiguration.RegisterWellKnownClientType(remote); // Ya podemos arrancar la aplicacion Application.Run(new Form1()); }
private RemotingConnection(RemotingProtocol remProt, string url, IDictionary propBag) { switch (remProt) { case (RemotingProtocol.Tcp): tcpCh = new TcpClientChannel(propBag, null); ChannelServices.RegisterChannel(tcpCh, false); break; case (RemotingProtocol.Http): httpCh = new HttpClientChannel(propBag, null); ChannelServices.RegisterChannel(httpCh, false); break; default: break; } Service = (T)Activator.GetObject(typeof(T), url); }