aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/RemoteServer/RemoteServer.cs
diff options
context:
space:
mode:
authorJeff Ames2008-05-18 23:06:50 +0000
committerJeff Ames2008-05-18 23:06:50 +0000
commit6ec680918bc6876f1c1382fb534b653fc34da052 (patch)
tree7eedbb3fa05b9540de9bba4a583795f1ba919de4 /OpenSim/Region/ScriptEngine/RemoteServer/RemoteServer.cs
parentUpdate svn properties. (diff)
downloadopensim-SC_OLD-6ec680918bc6876f1c1382fb534b653fc34da052.zip
opensim-SC_OLD-6ec680918bc6876f1c1382fb534b653fc34da052.tar.gz
opensim-SC_OLD-6ec680918bc6876f1c1382fb534b653fc34da052.tar.bz2
opensim-SC_OLD-6ec680918bc6876f1c1382fb534b653fc34da052.tar.xz
Formatting cleanup, minor refactoring. Fixed some comparisons of value types and null.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/RemoteServer/RemoteServer.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/RemoteServer/RemoteServer.cs21
1 files changed, 10 insertions, 11 deletions
diff --git a/OpenSim/Region/ScriptEngine/RemoteServer/RemoteServer.cs b/OpenSim/Region/ScriptEngine/RemoteServer/RemoteServer.cs
index 603808e..2a51b91 100644
--- a/OpenSim/Region/ScriptEngine/RemoteServer/RemoteServer.cs
+++ b/OpenSim/Region/ScriptEngine/RemoteServer/RemoteServer.cs
@@ -45,27 +45,25 @@ namespace OpenSim.Region.ScriptEngine.RemoteServer
45 ChannelServices.RegisterChannel(chan, true); 45 ChannelServices.RegisterChannel(chan, true);
46 } 46 }
47 47
48 /// <summary>
49 /// Create a channel for communicating w/ the remote object
50 /// Notice no port is specified on the client
51 /// </summary>
48 public ScriptServerInterfaces.ServerRemotingObject Connect(string hostname, int port) 52 public ScriptServerInterfaces.ServerRemotingObject Connect(string hostname, int port)
49 { 53 {
50 // Create a channel for communicating w/ the remote object 54 ScriptServerInterfaces.ServerRemotingObject obj = null;
51 // Notice no port is specified on the client 55
52
53 try 56 try
54 { 57 {
55 // Create an instance of the remote object 58 // Create an instance of the remote object
56 ScriptServerInterfaces.ServerRemotingObject obj = (ScriptServerInterfaces.ServerRemotingObject)Activator.GetObject( 59 obj = (ScriptServerInterfaces.ServerRemotingObject)Activator.GetObject(
57 typeof(ScriptServerInterfaces.ServerRemotingObject), 60 typeof(ScriptServerInterfaces.ServerRemotingObject),
58 "tcp://" + hostname + ":" + port + "/DotNetEngine"); 61 "tcp://" + hostname + ":" + port + "/DotNetEngine");
59 62
60 // Use the object 63 if (obj == null)
61 if (obj.Equals(null))
62 { 64 {
63 Console.WriteLine("Error: unable to locate server"); 65 Console.WriteLine("Error: unable to locate server");
64 } 66 }
65 else
66 {
67 return obj;
68 }
69 } 67 }
70 catch (SocketException) 68 catch (SocketException)
71 { 69 {
@@ -75,7 +73,8 @@ namespace OpenSim.Region.ScriptEngine.RemoteServer
75 { 73 {
76 Console.WriteLine("Error: unable to connect to server"); 74 Console.WriteLine("Error: unable to connect to server");
77 } 75 }
78 return null; 76
77 return obj;
79 } 78 }
80 } 79 }
81} 80}