Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 

46 wiersze
1.4 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Net;
  4. using System.Net.WebSockets;
  5. using System.Security.Principal;
  6. using System.Text;
  7. namespace JT1078.Gateway.Metadata
  8. {
  9. public class JT1078HttpContext
  10. {
  11. public string SessionId { get; }
  12. public HttpListenerContext Context { get; }
  13. public HttpListenerWebSocketContext WebSocketContext { get; }
  14. public IPrincipal User { get; }
  15. public string Sim { get; set; }
  16. public int ChannelNo { get; set; }
  17. public bool IsWebSocket
  18. {
  19. get
  20. {
  21. return Context.Request.IsWebSocketRequest;
  22. }
  23. }
  24. public DateTime ActiveTime { get; set; }
  25. public DateTime StartTime { get; set; }
  26. public JT1078HttpContext(HttpListenerContext context, IPrincipal user)
  27. {
  28. Context = context;
  29. User = user;
  30. ActiveTime = DateTime.Now;
  31. StartTime = DateTime.Now;
  32. SessionId = Guid.NewGuid().ToString("N");
  33. }
  34. public JT1078HttpContext(HttpListenerContext context, HttpListenerWebSocketContext webSocketContext, IPrincipal user)
  35. {
  36. Context = context;
  37. WebSocketContext = webSocketContext;
  38. User = user;
  39. ActiveTime = DateTime.Now;
  40. StartTime = DateTime.Now;
  41. SessionId = Guid.NewGuid().ToString("N");
  42. }
  43. }
  44. }