private void ReceiveSink(HTTPSession sender, HTTPMessage msg) { StateData stateObject = (StateData)sender.StateObject; object tag = stateObject.Tag; if ((msg.Version == "1.0") || (msg.Version == "0.9")) { sender.Close(); } else if (msg.GetTag("Connection").ToUpper() == "CLOSE") { sender.Close(); } if (this.OnResponse != null) { this.OnResponse(this, msg, tag); } sender.StateObject = null; lock (this.TagQueue) { if (this.TagQueue.Count == 0) { this.IdleTimeout = true; KeepAliveTimer.Add(this.GetHashCode(), 10); } } }
private void ReceiveSink(HTTPSession sender, HTTPMessage msg) { StateData sd = (StateData)sender.StateObject; object Tag = sd.Tag; if (msg.Version == "1.0" || msg.Version == "0.9") { sender.Close(); } else { if (msg.GetTag("Connection").ToUpper() == "CLOSE") { sender.Close(); } } if (OnResponse != null) { OnResponse(this, msg, Tag); } // If I don't set this to null, this holds a strong reference, resulting in // possible memory leaks sender.StateObject = null; lock (TagQueue) { if (TagQueue.Count == 0) { this.IdleTimeout = true; KeepAliveTimer.Add(this.GetHashCode(), 10); } } }
internal void ForceCloseSession() { try { s.Close(); } catch (Exception ex) { EventLogger.Log(ex); } }
public void Dispose() { lock (this.TagQueue) { HTTPSession s = this.s; if (s != null) { s.Close(); } this.s = null; this.TagQueue.Clear(); } }
/// <summary> /// Terminates and disposes this object /// </summary> public void Dispose() { lock (this.TagQueue) { HTTPSession x = this.s; if (x != null) { x.Close(); } s = null; TagQueue.Clear(); } }
private void SessionTimerSink(LifeTimeMonitor sender, object obj) { HTTPSession s = (HTTPSession)obj; s.Close(); }
/// <summary> /// This method gets called when we are done streaming the media /// </summary> /// <param name="sender"></param> /// <param name="S"></param> protected void DoneSink(HTTPSession sender, Stream S) { sender.CloseStreamObject(S); sender.Close(); }