public void AddContext(PodeContext context) { lock (Contexts) { Contexts.Add(context); } }
public PodeWebSocket(PodeContext context, string path, string clientId) { Context = context; Path = path; ClientId = clientId; Timestamp = DateTime.UtcNow; }
public PodeRequest(PodeRequest request) { IsSsl = request.IsSsl; InputStream = request.InputStream; IsKeepAlive = request.IsKeepAlive; Socket = request.Socket; RemoteEndPoint = Socket.RemoteEndPoint; Error = request.Error; Context = request.Context; }
public void SetContext(PodeContext context) { Context = context; }
public static void WriteErrorMessage(string message, PodeListener listener = default(PodeListener), PodeLoggingLevel level = PodeLoggingLevel.Error, PodeContext context = default(PodeContext)) { // do nothing if no message if (string.IsNullOrWhiteSpace(message)) { return; } // return if logging disabled, or if level isn't being logged if (listener != default(PodeListener) && (!listener.ErrorLoggingEnabled || !listener.ErrorLoggingLevels.Contains(level.ToString(), StringComparer.InvariantCultureIgnoreCase))) { return; } if (context == default(PodeContext)) { Console.WriteLine($"[{level}]: {message}"); } else { Console.WriteLine($"[{level}]: [ContextId: {context.ID}] {message}"); } }