void HTTPMonitor_StackDestroyed(object sender, TCPStreamMonitorEventArgs e) { InvokeExternalAsync(HTTPSessionMonitored, new HTTPMonitorEventArgs(dictConversations[e.Stack])); if (dictResponses[e.Stack].Count > 0) { InvokeExceptionThrown(new InvalidOperationException(this.Name + " was notified that a stack is being destroyed, but there are still requests missing in the HTTP conversation.")); } dictResponses.Remove(e.Stack); dictConversations.Remove(e.Stack); }
void HTTPMonitor_StackCreated(object sender, TCPStreamMonitorEventArgs e) { dictConversations.Add(e.Stack, new HTTPConversation(e.Stack.StackAlice.IPSocket.LocalBinding, e.Stack.StackBob.IPSocket.LocalBinding, e.Stack.StackAlice.TCPSocket.LocalBinding)); dictResponses.Add(e.Stack, new Queue <HTTPResponse>()); InvokeExternalAsync(HTTPSessionStarted, new HTTPMonitorEventArgs(dictConversations[e.Stack])); }