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 DebugMode { get; set; }
|
||||||
|
|
||||||
|
public bool AllowMultipleRequests { get; set; }
|
||||||
|
|
||||||
public virtual void Start()
|
public virtual void Start()
|
||||||
{
|
{
|
||||||
Log.Info("Start listening");
|
Log.Info("Start listening");
|
||||||
@@ -98,6 +100,7 @@ public class ApiServer(string apiUrl) : IApiServer
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Immitatly listen for new request
|
// Immitatly listen for new request
|
||||||
|
if (AllowMultipleRequests)
|
||||||
Receive();
|
Receive();
|
||||||
|
|
||||||
// Check context
|
// Check context
|
||||||
@@ -111,6 +114,10 @@ public class ApiServer(string apiUrl) : IApiServer
|
|||||||
if (DebugMode)
|
if (DebugMode)
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Listen for new request
|
||||||
|
if (!AllowMultipleRequests)
|
||||||
|
Receive();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void CheckContext(HttpListenerContext context)
|
protected virtual void CheckContext(HttpListenerContext context)
|
||||||
|
|||||||
Reference in New Issue
Block a user