diff options
author | MW | 2007-03-15 10:14:12 +0000 |
---|---|---|
committer | MW | 2007-03-15 10:14:12 +0000 |
commit | 8d1e9f83f338de21482547816834f4535cebf5bc (patch) | |
tree | b09bb3a9e1ba4eff9032929b0c3b99cbe08b9965 /src/CAPS | |
parent | Added simple mono/nant instructions (diff) | |
download | opensim-SC_OLD-8d1e9f83f338de21482547816834f4535cebf5bc.zip opensim-SC_OLD-8d1e9f83f338de21482547816834f4535cebf5bc.tar.gz opensim-SC_OLD-8d1e9f83f338de21482547816834f4535cebf5bc.tar.bz2 opensim-SC_OLD-8d1e9f83f338de21482547816834f4535cebf5bc.tar.xz |
Cleaned up IGridServer interfaces.
Added a try/catch around the http server Startup
Diffstat (limited to 'src/CAPS')
-rw-r--r-- | src/CAPS/SimHttp.cs | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/src/CAPS/SimHttp.cs b/src/CAPS/SimHttp.cs index eb20f3e..12bc9a8 100644 --- a/src/CAPS/SimHttp.cs +++ b/src/CAPS/SimHttp.cs | |||
@@ -38,6 +38,7 @@ using System.Collections; | |||
38 | using System.Collections.Generic; | 38 | using System.Collections.Generic; |
39 | using libsecondlife; | 39 | using libsecondlife; |
40 | using ServerConsole; | 40 | using ServerConsole; |
41 | using OpenSim.GridServers; | ||
41 | 42 | ||
42 | namespace OpenSim | 43 | namespace OpenSim |
43 | { | 44 | { |
@@ -54,16 +55,23 @@ namespace OpenSim | |||
54 | } | 55 | } |
55 | 56 | ||
56 | public void StartHTTP() { | 57 | public void StartHTTP() { |
57 | ServerConsole.MainConsole.Instance.WriteLine("SimHttp.cs:StartHTTP() - Spawned main thread OK"); | 58 | try |
58 | Listener = new HttpListener(); | 59 | { |
59 | 60 | ServerConsole.MainConsole.Instance.WriteLine("SimHttp.cs:StartHTTP() - Spawned main thread OK"); | |
60 | Listener.Prefixes.Add("http://+:" + OpenSim_Main.cfg.IPListenPort + "/"); | 61 | Listener = new HttpListener(); |
61 | Listener.Start(); | 62 | |
62 | 63 | Listener.Prefixes.Add("http://+:" + OpenSim_Main.cfg.IPListenPort + "/"); | |
63 | HttpListenerContext context; | 64 | Listener.Start(); |
64 | while(true) { | 65 | |
65 | context = Listener.GetContext(); | 66 | HttpListenerContext context; |
66 | ThreadPool.QueueUserWorkItem(new WaitCallback(HandleRequest), context); | 67 | while(true) { |
68 | context = Listener.GetContext(); | ||
69 | ThreadPool.QueueUserWorkItem(new WaitCallback(HandleRequest), context); | ||
70 | } | ||
71 | } | ||
72 | catch (Exception e) | ||
73 | { | ||
74 | ServerConsole.MainConsole.Instance.WriteLine(e.Message); | ||
67 | } | 75 | } |
68 | } | 76 | } |
69 | 77 | ||
@@ -81,7 +89,10 @@ namespace OpenSim | |||
81 | agent_data.lastname = (string)requestData["lastname"]; | 89 | agent_data.lastname = (string)requestData["lastname"]; |
82 | agent_data.AgentID = new LLUUID((string)requestData["agent_id"]); | 90 | agent_data.AgentID = new LLUUID((string)requestData["agent_id"]); |
83 | agent_data.circuitcode = Convert.ToUInt32(requestData["circuit_code"]); | 91 | agent_data.circuitcode = Convert.ToUInt32(requestData["circuit_code"]); |
84 | OpenSim_Main.gridServers.GridServer.agentcircuits.Add((uint)agent_data.circuitcode,agent_data); | 92 | if (OpenSim_Main.gridServers.GridServer.GetName() == "Remote") |
93 | { | ||
94 | ((RemoteGridBase) OpenSim_Main.gridServers.GridServer).agentcircuits.Add((uint)agent_data.circuitcode,agent_data); | ||
95 | } | ||
85 | return "<?xml version=\"1.0\"?><methodResponse><params /></methodResponse>"; | 96 | return "<?xml version=\"1.0\"?><methodResponse><params /></methodResponse>"; |
86 | break; | 97 | break; |
87 | } | 98 | } |