diff options
Diffstat (limited to 'OpenSim/Framework/Servers')
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 3 | ||||
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs | 12 |
2 files changed, 9 insertions, 6 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index eb7c578..96a030b 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | |||
@@ -1805,6 +1805,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
1805 | 1805 | ||
1806 | // Long Poll Service Manager with 3 worker threads a 25 second timeout for no events | 1806 | // Long Poll Service Manager with 3 worker threads a 25 second timeout for no events |
1807 | m_PollServiceManager = new PollServiceRequestManager(this, 3, 25000); | 1807 | m_PollServiceManager = new PollServiceRequestManager(this, 3, 25000); |
1808 | m_PollServiceManager.Start(); | ||
1808 | HTTPDRunning = true; | 1809 | HTTPDRunning = true; |
1809 | 1810 | ||
1810 | //HttpListenerContext context; | 1811 | //HttpListenerContext context; |
@@ -1855,7 +1856,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
1855 | HTTPDRunning = false; | 1856 | HTTPDRunning = false; |
1856 | try | 1857 | try |
1857 | { | 1858 | { |
1858 | // m_PollServiceManager.Stop(); | 1859 | m_PollServiceManager.Stop(); |
1859 | 1860 | ||
1860 | m_httpListener2.ExceptionThrown -= httpServerException; | 1861 | m_httpListener2.ExceptionThrown -= httpServerException; |
1861 | //m_httpListener2.DisconnectHandler = null; | 1862 | //m_httpListener2.DisconnectHandler = null; |
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs index a5380c1..aee3e3c 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs | |||
@@ -66,14 +66,17 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
66 | m_server = pSrv; | 66 | m_server = pSrv; |
67 | m_WorkerThreadCount = pWorkerThreadCount; | 67 | m_WorkerThreadCount = pWorkerThreadCount; |
68 | m_workerThreads = new Thread[m_WorkerThreadCount]; | 68 | m_workerThreads = new Thread[m_WorkerThreadCount]; |
69 | } | ||
69 | 70 | ||
71 | public void Start() | ||
72 | { | ||
70 | //startup worker threads | 73 | //startup worker threads |
71 | for (uint i = 0; i < m_WorkerThreadCount; i++) | 74 | for (uint i = 0; i < m_WorkerThreadCount; i++) |
72 | { | 75 | { |
73 | m_workerThreads[i] | 76 | m_workerThreads[i] |
74 | = Watchdog.StartThread( | 77 | = Watchdog.StartThread( |
75 | PoolWorkerJob, | 78 | PoolWorkerJob, |
76 | String.Format("PollServiceWorkerThread{0}", i), | 79 | string.Format("PollServiceWorkerThread{0}:{1}", i, m_server.Port), |
77 | ThreadPriority.Normal, | 80 | ThreadPriority.Normal, |
78 | false, | 81 | false, |
79 | false, | 82 | false, |
@@ -83,7 +86,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
83 | 86 | ||
84 | m_retrysThread = Watchdog.StartThread( | 87 | m_retrysThread = Watchdog.StartThread( |
85 | this.CheckRetries, | 88 | this.CheckRetries, |
86 | "PollServiceWatcherThread", | 89 | string.Format("PollServiceWatcherThread:{0}", m_server.Port), |
87 | ThreadPriority.Normal, | 90 | ThreadPriority.Normal, |
88 | false, | 91 | false, |
89 | true, | 92 | true, |
@@ -91,7 +94,6 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
91 | 1000 * 60 * 10); | 94 | 1000 * 60 * 10); |
92 | } | 95 | } |
93 | 96 | ||
94 | |||
95 | private void ReQueueEvent(PollServiceHttpRequest req) | 97 | private void ReQueueEvent(PollServiceHttpRequest req) |
96 | { | 98 | { |
97 | if (m_running) | 99 | if (m_running) |
@@ -142,14 +144,14 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
142 | } | 144 | } |
143 | } | 145 | } |
144 | 146 | ||
145 | ~PollServiceRequestManager() | 147 | public void Stop() |
146 | { | 148 | { |
147 | m_running = false; | 149 | m_running = false; |
148 | // m_timeout = -10000; // cause all to expire | 150 | // m_timeout = -10000; // cause all to expire |
149 | Thread.Sleep(1000); // let the world move | 151 | Thread.Sleep(1000); // let the world move |
150 | 152 | ||
151 | foreach (Thread t in m_workerThreads) | 153 | foreach (Thread t in m_workerThreads) |
152 | Watchdog.AbortThread(t.ManagedThreadId); | 154 | Watchdog.AbortThread(t.ManagedThreadId); |
153 | 155 | ||
154 | try | 156 | try |
155 | { | 157 | { |