public void Invoke(HttpListenerContext c) { var m = new ServerTransport<Message[]>(c.Request.InputStream); ServerSession s = null; if (!this.Clients.ContainsKey(m.Descriptor.Description)) { s = DefaultSession; } else { s = Clients[m.Descriptor.Description]; var now = DateTime.Now; //Console.Write("*"); //Console.WriteLine("Client: " + s.ClientName + " client was offline " + new TimeSpan(now.Ticks - s.LastSeen.Ticks).ToString()); // params for server s.LastSeen = now; s.LastRequest = c.Request; } m.Data = s.Invoke(m.Data, c); if (m.Data.Length == 0) { c.Response.StatusCode = 204; } else { m.WriteTo(c.Response.OutputStream); } c.Response.Close(); }