aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorUbitUmarov2012-07-04 17:58:32 +0100
committerUbitUmarov2012-07-04 17:58:32 +0100
commitbc5d554f548e973221f8a18cdcb5a5883ed6039f (patch)
tree52625db11dfd6484a2d37daabe11fed16bd69ae7 /OpenSim/Framework
parent added a timeout paramenter to PollServiceEventArgs, so each type can define ... (diff)
downloadopensim-SC-bc5d554f548e973221f8a18cdcb5a5883ed6039f.zip
opensim-SC-bc5d554f548e973221f8a18cdcb5a5883ed6039f.tar.gz
opensim-SC-bc5d554f548e973221f8a18cdcb5a5883ed6039f.tar.bz2
opensim-SC-bc5d554f548e973221f8a18cdcb5a5883ed6039f.tar.xz
use the pollEvent timeout paramenter on pooling
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs11
1 files changed, 7 insertions, 4 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs
index 125d9c2..45b1375 100644
--- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs
+++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs
@@ -182,7 +182,7 @@ namespace OpenSim.Framework.Servers.HttpServer
182 182
183 private bool m_running = true; 183 private bool m_running = true;
184 184
185 private int m_timeout = 1000; // increase timeout 250; 185// private int m_timeout = 1000; // increase timeout 250; now use the event one
186 186
187 public PollServiceRequestManager(BaseHttpServer pSrv, uint pWorkerThreadCount, int pTimeout) 187 public PollServiceRequestManager(BaseHttpServer pSrv, uint pWorkerThreadCount, int pTimeout)
188 { 188 {
@@ -245,7 +245,7 @@ namespace OpenSim.Framework.Servers.HttpServer
245 ~PollServiceRequestManager() 245 ~PollServiceRequestManager()
246 { 246 {
247 m_running = false; 247 m_running = false;
248 m_timeout = -10000; // cause all to expire 248// m_timeout = -10000; // cause all to expire
249 Thread.Sleep(1000); // let the world move 249 Thread.Sleep(1000); // let the world move
250 250
251 foreach (Thread t in m_workerThreads) 251 foreach (Thread t in m_workerThreads)
@@ -299,7 +299,8 @@ namespace OpenSim.Framework.Servers.HttpServer
299 PollServiceHttpRequest req; 299 PollServiceHttpRequest req;
300 StreamReader str; 300 StreamReader str;
301 301
302 while (true) 302// while (true)
303 while (m_running)
303 { 304 {
304 req = m_requests.Dequeue(5000); 305 req = m_requests.Dequeue(5000);
305 306
@@ -338,7 +339,9 @@ namespace OpenSim.Framework.Servers.HttpServer
338 } 339 }
339 else 340 else
340 { 341 {
341 if ((Environment.TickCount - req.RequestTime) > m_timeout) 342// if ((Environment.TickCount - req.RequestTime) > m_timeout)
343
344 if ((Environment.TickCount - req.RequestTime) > req.PollServiceArgs.TimeOutms)
342 { 345 {
343 m_server.DoHTTPGruntWork(req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id), 346 m_server.DoHTTPGruntWork(req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id),
344 new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request), req.HttpContext)); 347 new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request), req.HttpContext));