Files
RobustToolbox/Robust.Server/Interfaces/ServerStatus/IStatusHost.cs
Pieter-Jan Briers 2b39c05472 Return of the HttpListener. (#1423)
Microsoft isn't supporting NuGet-components ASP.NET Core ever since 3.x so using Kestrel is out.

New implementation is 100% thread pool compared to the old one which was a single specific thread.
2020-11-26 23:57:52 +01:00

36 lines
1.1 KiB
C#

using System;
using System.Net;
using System.Net.Http;
using Newtonsoft.Json.Linq;
namespace Robust.Server.Interfaces.ServerStatus
{
public delegate bool StatusHostHandler(
HttpMethod method,
HttpListenerRequest request,
HttpListenerResponse response);
public interface IStatusHost
{
void Start();
void AddHandler(StatusHostHandler handler);
/// <summary>
/// Invoked when a client queries a status request from the server.
/// THIS IS INVOKED FROM ANOTHER THREAD.
/// I REPEAT, THIS DOES NOT RUN ON THE MAIN THREAD.
/// MAKE TRIPLE SURE EVERYTHING IN HERE IS THREAD SAFE DEAR GOD.
/// </summary>
event Action<JObject> OnStatusRequest;
/// <summary>
/// Invoked when a client queries an info request from the server.
/// THIS IS INVOKED FROM ANOTHER THREAD.
/// I REPEAT, THIS DOES NOT RUN ON THE MAIN THREAD.
/// MAKE TRIPLE SURE EVERYTHING IN HERE IS THREAD SAFE DEAR GOD.
/// </summary>
event Action<JObject> OnInfoRequest;
}
}