public void AddCrashReport(UserInfo user, string callstack) { var entry = new Entry(user); if (!CrashReports.ContainsKey(entry)) { CrashReports.Add(entry, callstack); PersistanceCheckpoint(); } }
public void AddPresenceReport(UserInfo user) { bool exists = PresenceReports.Exists((Entry e) => e.user.IPAddress == user.IPAddress && e.user.MachineName == user.MachineName && e.date.Date == DateTime.Today); if (!exists) { PresenceReports.Add(new Entry(user)); PersistanceCheckpoint(); } }
private void ProcessCrashRequest(HttpListenerContext context) { HttpListenerRequest request = context.Request; if (request.HasEntityBody) { var client_stream = new System.IO.StreamReader(request.InputStream, request.ContentEncoding); string callstack = client_stream.ReadToEnd(); var user = new UserInfo(context.Request); if (user.IsValid()) { _storage.AddCrashReport(user, callstack); Console.WriteLine(string.Format("{0} => crash", user.ToString())); } } }
public Entry(UserInfo user) { this.user = user; this.date = DateTime.Now; }
private void ProcessPresenceRequest(HttpListenerContext context) { var user = new UserInfo(context.Request); if (user.IsValid()) { _storage.AddPresenceReport(user); Console.WriteLine(string.Format("{0} => presence", user.ToString())); } }