public PollServiceTextureEventArgs(UUID pId, Scene scene) : base(null, "", null, null, null, null, pId, int.MaxValue) { m_scene = scene; m_throttler = new CapsDataThrottler(200000); // x is request id, y is userid HasEvents = (x, y) => { lock (responses) { bool ret = m_throttler.hasEvents(x, responses); return(ret); } }; Drop = (x, y) => { lock (responses) { responses.Remove(x); dropedResponses.Add(x); } }; GetEvents = (x, y) => { lock (responses) { try { return(responses[x].response); } finally { responses.Remove(x); m_throttler.PassTime(); } } }; // x is request id, y is request data hashtable Request = (x, y) => { APollRequest reqinfo = new APollRequest(); reqinfo.thepoll = this; reqinfo.reqID = x; reqinfo.request = y; reqinfo.send503 = false; lock (responses) { if (responses.Count > 0) { if (m_queue.Count >= 4) { // Never allow more than 4 fetches to wait reqinfo.send503 = true; } } } m_queue.Add(reqinfo); m_throttler.PassTime(); }; // this should never happen except possible on shutdown NoEvents = (x, y) => { /* * lock (requests) * { * Hashtable request = requests.Find(id => id["RequestID"].ToString() == x.ToString()); * requests.Remove(request); * } */ Hashtable response = new Hashtable(); response["int_response_code"] = 500; response["str_response_string"] = "Script timeout"; response["content_type"] = "text/plain"; response["keepalive"] = false; response["reusecontext"] = false; return(response); }; }