diff options
author | Jeff Ames | 2007-12-31 12:00:40 +0000 |
---|---|---|
committer | Jeff Ames | 2007-12-31 12:00:40 +0000 |
commit | 3c9505199a1ff61a3fc9bf1bc6d9592276a8fda1 (patch) | |
tree | c96852dedf4ce6a93309b7f74f62f6b025f90b60 /OpenSim/Region/ScriptEngine/RemoteServer/RemoteServer.cs | |
parent | Changed from "Load all .dll's in ScriptEngine" to "Load only DotNetEngine" (t... (diff) | |
download | opensim-SC_OLD-3c9505199a1ff61a3fc9bf1bc6d9592276a8fda1.zip opensim-SC_OLD-3c9505199a1ff61a3fc9bf1bc6d9592276a8fda1.tar.gz opensim-SC_OLD-3c9505199a1ff61a3fc9bf1bc6d9592276a8fda1.tar.bz2 opensim-SC_OLD-3c9505199a1ff61a3fc9bf1bc6d9592276a8fda1.tar.xz |
Set svn:eol-style and svn:ignore.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/RemoteServer/RemoteServer.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/RemoteServer/RemoteServer.cs | 116 |
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 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Collections.Generic; | 2 | using System.Collections.Generic; |
3 | using System.Text; | 3 | using System.Text; |
4 | using System.Runtime.Remoting; | 4 | using System.Runtime.Remoting; |
5 | using System.Runtime.Remoting.Channels; | 5 | using System.Runtime.Remoting.Channels; |
6 | using System.Runtime.Remoting.Channels.Tcp; | 6 | using System.Runtime.Remoting.Channels.Tcp; |
7 | 7 | ||
8 | namespace OpenSim.Region.ScriptEngine.RemoteServer | 8 | namespace 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 | } |