add toggle to for processing multiple requests
This commit is contained in:
@@ -26,6 +26,8 @@ public class ApiServer(string apiUrl) : IApiServer
|
||||
|
||||
public bool DebugMode { get; set; }
|
||||
|
||||
public bool AllowMultipleRequests { get; set; }
|
||||
|
||||
public virtual void Start()
|
||||
{
|
||||
Log.Info("Start listening");
|
||||
@@ -98,7 +100,8 @@ public class ApiServer(string apiUrl) : IApiServer
|
||||
}
|
||||
|
||||
// Immitatly listen for new request
|
||||
Receive();
|
||||
if (AllowMultipleRequests)
|
||||
Receive();
|
||||
|
||||
// Check context
|
||||
try
|
||||
@@ -111,6 +114,10 @@ public class ApiServer(string apiUrl) : IApiServer
|
||||
if (DebugMode)
|
||||
throw;
|
||||
}
|
||||
|
||||
// Listen for new request
|
||||
if (!AllowMultipleRequests)
|
||||
Receive();
|
||||
}
|
||||
|
||||
protected virtual void CheckContext(HttpListenerContext context)
|
||||
|
||||
Reference in New Issue
Block a user