aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/RemoteServer/RemoteServer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/RemoteServer/RemoteServer.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/RemoteServer/RemoteServer.cs116
1 files changed, 58 insertions, 58 deletions
diff --git a/OpenSim/Region/ScriptEngine/RemoteServer/RemoteServer.cs b/OpenSim/Region/ScriptEngine/RemoteServer/RemoteServer.cs
index e5db72d..3c88c41 100644
--- a/OpenSim/Region/ScriptEngine/RemoteServer/RemoteServer.cs
+++ b/OpenSim/Region/ScriptEngine/RemoteServer/RemoteServer.cs
@@ -1,58 +1,58 @@
1using System; 1using System;
2using System.Collections.Generic; 2using System.Collections.Generic;
3using System.Text; 3using System.Text;
4using System.Runtime.Remoting; 4using System.Runtime.Remoting;
5using System.Runtime.Remoting.Channels; 5using System.Runtime.Remoting.Channels;
6using System.Runtime.Remoting.Channels.Tcp; 6using System.Runtime.Remoting.Channels.Tcp;
7 7
8namespace OpenSim.Region.ScriptEngine.RemoteServer 8namespace OpenSim.Region.ScriptEngine.RemoteServer
9{ 9{
10 class RemoteServer 10 class RemoteServer
11 { 11 {
12 // Handles connections to servers 12 // Handles connections to servers
13 // Create and returns server object 13 // Create and returns server object
14 14
15 public OpenSim.Grid.ScriptServer.RemotingObject Connect(string hostname, int port) 15 public OpenSim.Grid.ScriptServer.RemotingObject Connect(string hostname, int port)
16 { 16 {
17 // Create a channel for communicating w/ the remote object 17 // Create a channel for communicating w/ the remote object
18 // Notice no port is specified on the client 18 // Notice no port is specified on the client
19 TcpChannel chan = new TcpChannel(); 19 TcpChannel chan = new TcpChannel();
20 try 20 try
21 { 21 {
22 ChannelServices.RegisterChannel(chan, true); 22 ChannelServices.RegisterChannel(chan, true);
23 } 23 }
24 catch (System.Runtime.Remoting.RemotingException) 24 catch (System.Runtime.Remoting.RemotingException)
25 { 25 {
26 System.Console.WriteLine("Error: tcp already registered, RemoteServer.cs in OpenSim.Region.ScriptEngine.RemoteServer line 24"); 26 System.Console.WriteLine("Error: tcp already registered, RemoteServer.cs in OpenSim.Region.ScriptEngine.RemoteServer line 24");
27 } 27 }
28 try 28 try
29 { 29 {
30 30
31 // Create an instance of the remote object 31 // Create an instance of the remote object
32 OpenSim.Grid.ScriptServer.RemotingObject obj = (OpenSim.Grid.ScriptServer.RemotingObject)Activator.GetObject( 32 OpenSim.Grid.ScriptServer.RemotingObject obj = (OpenSim.Grid.ScriptServer.RemotingObject)Activator.GetObject(
33 typeof(OpenSim.Grid.ScriptServer.RemotingObject), 33 typeof(OpenSim.Grid.ScriptServer.RemotingObject),
34 "tcp://" + hostname + ":" + port + "/DotNetEngine"); 34 "tcp://" + hostname + ":" + port + "/DotNetEngine");
35 35
36 // Use the object 36 // Use the object
37 if (obj.Equals(null)) 37 if (obj.Equals(null))
38 { 38 {
39 System.Console.WriteLine("Error: unable to locate server"); 39 System.Console.WriteLine("Error: unable to locate server");
40 } 40 }
41 else 41 else
42 { 42 {
43 return obj; 43 return obj;
44 } 44 }
45 } 45 }
46 catch (System.Net.Sockets.SocketException) 46 catch (System.Net.Sockets.SocketException)
47 { 47 {
48 System.Console.WriteLine("Error: unable to connect to server"); 48 System.Console.WriteLine("Error: unable to connect to server");
49 } 49 }
50 catch (System.Runtime.Remoting.RemotingException) 50 catch (System.Runtime.Remoting.RemotingException)
51 { 51 {
52 System.Console.WriteLine("Error: unable to connect to server"); 52 System.Console.WriteLine("Error: unable to connect to server");
53 } 53 }
54 return null; 54 return null;
55 55
56 } 56 }
57 } 57 }
58} 58}