aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Communications/OGS1
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Communications/OGS1')
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1GridServices.cs131
1 files changed, 73 insertions, 58 deletions
diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
index f8ab9ef..1953140 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
@@ -825,77 +825,92 @@ namespace OpenSim.Region.Communications.OGS1
825 /// <returns></returns> 825 /// <returns></returns>
826 public bool InformRegionOfPrimCrossing(ulong regionHandle, LLUUID primID, string objData) 826 public bool InformRegionOfPrimCrossing(ulong regionHandle, LLUUID primID, string objData)
827 { 827 {
828 RegionInfo regInfo = null; 828 int failures = 0;
829 try 829 lock (m_deadRegionCache)
830 { 830 {
831 if (m_localBackend.InformRegionOfPrimCrossing(regionHandle, primID, objData)) 831 if (m_deadRegionCache.ContainsKey(regionHandle))
832 { 832 {
833 return true; 833 failures = m_deadRegionCache[regionHandle];
834 } 834 }
835 835 }
836 regInfo = RequestNeighbourInfo(regionHandle); 836 if (failures <= 3)
837 if (regInfo != null) 837 {
838 RegionInfo regInfo = null;
839 try
838 { 840 {
839 //don't want to be creating a new link to the remote instance every time like we are here 841 if (m_localBackend.InformRegionOfPrimCrossing(regionHandle, primID, objData))
840 bool retValue = false;
841
842
843 OGS1InterRegionRemoting remObject = (OGS1InterRegionRemoting) Activator.GetObject(
844 typeof (OGS1InterRegionRemoting),
845 "tcp://" + regInfo.RemotingAddress +
846 ":" + regInfo.RemotingPort +
847 "/InterRegions");
848
849 if (remObject != null)
850 { 842 {
851 retValue = remObject.InformRegionOfPrimCrossing(regionHandle, primID.UUID, objData); 843 return true;
852 } 844 }
853 else 845
846 regInfo = RequestNeighbourInfo(regionHandle);
847 if (regInfo != null)
854 { 848 {
855 Console.WriteLine("remoting object not found"); 849 //don't want to be creating a new link to the remote instance every time like we are here
856 } 850 bool retValue = false;
857 remObject = null;
858 851
859 852
860 return retValue; 853 OGS1InterRegionRemoting remObject = (OGS1InterRegionRemoting)Activator.GetObject(
854 typeof(OGS1InterRegionRemoting),
855 "tcp://" + regInfo.RemotingAddress +
856 ":" + regInfo.RemotingPort +
857 "/InterRegions");
858
859 if (remObject != null)
860 {
861 retValue = remObject.InformRegionOfPrimCrossing(regionHandle, primID.UUID, objData);
862 }
863 else
864 {
865 Console.WriteLine("remoting object not found");
866 }
867 remObject = null;
868
869
870 return retValue;
871 }
872 NoteDeadRegion(regionHandle);
873 return false;
861 } 874 }
862 NoteDeadRegion(regionHandle); 875 catch (RemotingException e)
863 return false; 876 {
864 } 877 NoteDeadRegion(regionHandle);
865 catch (RemotingException e) 878 m_log.Warn("Remoting Error: Unable to connect to adjacent region: " + regionHandle);
866 { 879 m_log.Debug(e.ToString());
867 NoteDeadRegion(regionHandle); 880 return false;
868 m_log.Warn("Remoting Error: Unable to connect to adjacent region: " + regionHandle); 881 }
869 m_log.Debug(e.ToString()); 882 catch (SocketException e)
870 return false; 883 {
871 } 884 NoteDeadRegion(regionHandle);
872 catch (SocketException e) 885 m_log.Warn("Remoting Error: Unable to connect to adjacent region: " + regionHandle);
873 { 886 m_log.Debug(e.ToString());
874 NoteDeadRegion(regionHandle); 887 return false;
875 m_log.Warn("Remoting Error: Unable to connect to adjacent region: " + regionHandle); 888 }
876 m_log.Debug(e.ToString()); 889 catch (InvalidCredentialException e)
877 return false; 890 {
878 } 891 NoteDeadRegion(regionHandle);
879 catch (InvalidCredentialException e) 892 m_log.Warn("Invalid Credential Exception: Invalid Credentials : " + regionHandle);
880 { 893 m_log.Debug(e.ToString());
881 NoteDeadRegion(regionHandle); 894 return false;
882 m_log.Warn("Invalid Credential Exception: Invalid Credentials : " + regionHandle); 895 }
883 m_log.Debug(e.ToString()); 896 catch (AuthenticationException e)
884 return false; 897 {
885 } 898 NoteDeadRegion(regionHandle);
886 catch (AuthenticationException e) 899 m_log.Warn("Authentication exception: Unable to connect to adjacent region: " + regionHandle);
887 {
888 NoteDeadRegion(regionHandle);
889 m_log.Warn("Authentication exception: Unable to connect to adjacent region: " + regionHandle);
890 900
891 m_log.Debug(e.ToString()); 901 m_log.Debug(e.ToString());
892 return false; 902 return false;
903 }
904 catch (Exception e)
905 {
906 NoteDeadRegion(regionHandle);
907 m_log.Warn("Unknown exception: Unable to connect to adjacent region: " + regionHandle);
908 m_log.Debug(e.ToString());
909 return false;
910 }
893 } 911 }
894 catch (Exception e) 912 else
895 { 913 {
896 NoteDeadRegion(regionHandle);
897 m_log.Warn("Unknown exception: Unable to connect to adjacent region: " + regionHandle);
898 m_log.Debug(e.ToString());
899 return false; 914 return false;
900 } 915 }
901 } 916 }