diff options
author | Melanie | 2009-09-28 23:03:47 +0100 |
---|---|---|
committer | Melanie | 2009-09-28 23:03:47 +0100 |
commit | 07091493134341a316624d9a1f6a2ef1cfa2f2d8 (patch) | |
tree | 1d394e128be9766656a441058b2bdf141ba90269 /OpenSim/Framework/Util.cs | |
parent | Allow the notation config_name@port/dll_name:class_name as a handler spec (diff) | |
parent | Forgot a return statement. (diff) | |
download | opensim-SC_OLD-07091493134341a316624d9a1f6a2ef1cfa2f2d8.zip opensim-SC_OLD-07091493134341a316624d9a1f6a2ef1cfa2f2d8.tar.gz opensim-SC_OLD-07091493134341a316624d9a1f6a2ef1cfa2f2d8.tar.bz2 opensim-SC_OLD-07091493134341a316624d9a1f6a2ef1cfa2f2d8.tar.xz |
Merge branch 'grid-service-redux'
Diffstat (limited to 'OpenSim/Framework/Util.cs')
-rw-r--r-- | OpenSim/Framework/Util.cs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 45b5a10..a28a617 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -1203,6 +1203,32 @@ namespace OpenSim.Framework | |||
1203 | return found.ToArray(); | 1203 | return found.ToArray(); |
1204 | } | 1204 | } |
1205 | 1205 | ||
1206 | public static string ServerURI(string uri) | ||
1207 | { | ||
1208 | if (uri == string.Empty) | ||
1209 | return string.Empty; | ||
1210 | |||
1211 | // Get rid of eventual slashes at the end | ||
1212 | uri = uri.TrimEnd('/'); | ||
1213 | |||
1214 | IPAddress ipaddr1 = null; | ||
1215 | string port1 = ""; | ||
1216 | try | ||
1217 | { | ||
1218 | ipaddr1 = Util.GetHostFromURL(uri); | ||
1219 | } | ||
1220 | catch { } | ||
1221 | |||
1222 | try | ||
1223 | { | ||
1224 | port1 = uri.Split(new char[] { ':' })[2]; | ||
1225 | } | ||
1226 | catch { } | ||
1227 | |||
1228 | // We tried our best to convert the domain names to IP addresses | ||
1229 | return (ipaddr1 != null) ? "http://" + ipaddr1.ToString() + ":" + port1 : uri; | ||
1230 | } | ||
1231 | |||
1206 | #region FireAndForget Threading Pattern | 1232 | #region FireAndForget Threading Pattern |
1207 | 1233 | ||
1208 | public static void FireAndForget(System.Threading.WaitCallback callback) | 1234 | public static void FireAndForget(System.Threading.WaitCallback callback) |