From c52f9c04e28023a54e51b941b57872322417ac1c Mon Sep 17 00:00:00 2001
From: Adam Frisby
Date: Wed, 18 Jul 2007 00:27:11 +0000
Subject: * One hopefully-final attempt at fixing this remoting issue.
---
.../Region/Communications/OGS1/OGS1GridServices.cs | 112 ++++++++++++---------
1 file changed, 64 insertions(+), 48 deletions(-)
(limited to 'OpenSim/Region/Communications')
diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
index a859826..13a37dd 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
@@ -335,37 +335,45 @@ namespace OpenSim.Region.Communications.OGS1
///
public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData)
{
- if (this.listeners.ContainsKey(regionHandle))
- {
- this.listeners[regionHandle].TriggerExpectUser(regionHandle, agentData);
- return true;
- }
- RegionInfo regInfo = this.RequestNeighbourInfo(regionHandle);
- if (regInfo != null)
+ try
{
- //don't want to be creating a new link to the remote instance every time like we are here
- bool retValue = false;
-
-
- OGS1InterRegionRemoting remObject = (OGS1InterRegionRemoting)Activator.GetObject(
- typeof(OGS1InterRegionRemoting),
- "tcp://"+ regInfo.RemotingAddress+":"+regInfo.RemotingPort+"/InterRegions");
- if (remObject != null)
+ if (this.listeners.ContainsKey(regionHandle))
{
-
- retValue = remObject.InformRegionOfChildAgent(regionHandle, agentData);
+ this.listeners[regionHandle].TriggerExpectUser(regionHandle, agentData);
+ return true;
}
- else
+ RegionInfo regInfo = this.RequestNeighbourInfo(regionHandle);
+ if (regInfo != null)
{
- Console.WriteLine("remoting object not found");
- }
- remObject = null;
+ //don't want to be creating a new link to the remote instance every time like we are here
+ bool retValue = false;
+
+
+ OGS1InterRegionRemoting remObject = (OGS1InterRegionRemoting)Activator.GetObject(
+ typeof(OGS1InterRegionRemoting),
+ "tcp://" + regInfo.RemotingAddress + ":" + regInfo.RemotingPort + "/InterRegions");
+ if (remObject != null)
+ {
+
+ retValue = remObject.InformRegionOfChildAgent(regionHandle, agentData);
+ }
+ else
+ {
+ Console.WriteLine("remoting object not found");
+ }
+ remObject = null;
- return retValue;
+ return retValue;
+ }
+
+ return false;
+ }
+ catch (System.Runtime.Remoting.RemotingException e)
+ {
+ MainLog.Instance.Error("Remoting Error: Unable to connect to remote region.\n" + e.ToString());
+ return false;
}
-
- return false;
}
///
@@ -377,37 +385,45 @@ namespace OpenSim.Region.Communications.OGS1
///
public bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position)
{
- if (this.listeners.ContainsKey(regionHandle))
- {
- this.listeners[regionHandle].TriggerExpectAvatarCrossing(regionHandle, agentID, position);
- return true;
- }
- RegionInfo regInfo = this.RequestNeighbourInfo(regionHandle);
- if (regInfo != null)
+ try
{
- bool retValue = false;
-
-
- OGS1InterRegionRemoting remObject = (OGS1InterRegionRemoting)Activator.GetObject(
- typeof(OGS1InterRegionRemoting),
- "tcp://" + regInfo.RemotingAddress + ":" + regInfo.RemotingPort + "/InterRegions");
- if (remObject != null)
+ if (this.listeners.ContainsKey(regionHandle))
{
-
- retValue = remObject.ExpectAvatarCrossing(regionHandle, agentID, position);
+ this.listeners[regionHandle].TriggerExpectAvatarCrossing(regionHandle, agentID, position);
+ return true;
}
- else
+ RegionInfo regInfo = this.RequestNeighbourInfo(regionHandle);
+ if (regInfo != null)
{
- Console.WriteLine("remoting object not found");
- }
- remObject = null;
+ bool retValue = false;
+
+
+ OGS1InterRegionRemoting remObject = (OGS1InterRegionRemoting)Activator.GetObject(
+ typeof(OGS1InterRegionRemoting),
+ "tcp://" + regInfo.RemotingAddress + ":" + regInfo.RemotingPort + "/InterRegions");
+ if (remObject != null)
+ {
+
+ retValue = remObject.ExpectAvatarCrossing(regionHandle, agentID, position);
+ }
+ else
+ {
+ Console.WriteLine("remoting object not found");
+ }
+ remObject = null;
- return retValue;
+ return retValue;
+ }
+ //TODO need to see if we know about where this region is and use .net remoting
+ // to inform it.
+ return false;
+ }
+ catch (System.Runtime.Remoting.RemotingException e)
+ {
+ MainLog.Instance.Error("Remoting Error: Unable to connect to remote region.\n" + e.ToString());
+ return false;
}
- //TODO need to see if we know about where this region is and use .net remoting
- // to inform it.
- return false;
}
#endregion
--
cgit v1.1