aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/RemoteServer/RemoteServer.cs
diff options
context:
space:
mode:
authorTeravus Ovares2007-12-30 23:56:29 +0000
committerTeravus Ovares2007-12-30 23:56:29 +0000
commit373d801c400f8c4da8bc55ed8637a42be8c6e927 (patch)
tree9e27367e999e5a96b51d5ac539a1cf4c111a17da /OpenSim/Region/ScriptEngine/RemoteServer/RemoteServer.cs
parent* Fixed References in Prebuild so the project compiles (diff)
downloadopensim-SC_OLD-373d801c400f8c4da8bc55ed8637a42be8c6e927.zip
opensim-SC_OLD-373d801c400f8c4da8bc55ed8637a42be8c6e927.tar.gz
opensim-SC_OLD-373d801c400f8c4da8bc55ed8637a42be8c6e927.tar.bz2
opensim-SC_OLD-373d801c400f8c4da8bc55ed8637a42be8c6e927.tar.xz
* Added graceful remote script server connection error handling
* Removed a friends module test that I had.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/RemoteServer/RemoteServer.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/RemoteServer/RemoteServer.cs36
1 files changed, 25 insertions, 11 deletions
diff --git a/OpenSim/Region/ScriptEngine/RemoteServer/RemoteServer.cs b/OpenSim/Region/ScriptEngine/RemoteServer/RemoteServer.cs
index 1a528c8..4fff20d 100644
--- a/OpenSim/Region/ScriptEngine/RemoteServer/RemoteServer.cs
+++ b/OpenSim/Region/ScriptEngine/RemoteServer/RemoteServer.cs
@@ -17,21 +17,35 @@ namespace OpenSim.Region.ScriptEngine.RemoteServer
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 ChannelServices.RegisterChannel(chan, true); 20 try
21 {
22 ChannelServices.RegisterChannel(chan, true);
23 }
24 catch (System.Runtime.Remoting.RemotingException)
25 {
26 System.Console.WriteLine("Error: tcp already registered, RemoteServer.cs in OpenSim.Region.ScriptEngine.RemoteServer line 24");
27 }
28 try
29 {
21 30
22 // Create an instance of the remote object 31 // Create an instance of the remote object
23 OpenSim.Grid.ScriptServer.RemotingObject obj = (OpenSim.Grid.ScriptServer.RemotingObject)Activator.GetObject( 32 OpenSim.Grid.ScriptServer.RemotingObject obj = (OpenSim.Grid.ScriptServer.RemotingObject)Activator.GetObject(
24 typeof(OpenSim.Grid.ScriptServer.RemotingObject), 33 typeof(OpenSim.Grid.ScriptServer.RemotingObject),
25 "tcp://" + hostname + ":" + port + "/DotNetEngine"); 34 "tcp://" + hostname + ":" + port + "/DotNetEngine");
26 35
27 // Use the object 36 // Use the object
28 if (obj.Equals(null)) 37 if (obj.Equals(null))
29 { 38 {
30 System.Console.WriteLine("Error: unable to locate server"); 39 System.Console.WriteLine("Error: unable to locate server");
40 }
41 else
42 {
43 return obj;
44 }
31 } 45 }
32 else 46 catch (System.Net.Sockets.SocketException)
33 { 47 {
34 return obj; 48 System.Console.WriteLine("Error: unable to connect to server");
35 } 49 }
36 return null; 50 return null;
37 51