Interface IHttpServer
Describes an abstract HTTP server.
Inherited Members
Solti.Utils.Primitives.Patterns.IDisposableEx.Disposed
Namespace: Solti.Utils.Rpc.Interfaces
Assembly: Solti.Utils.Rpc.Interfaces.dll
Syntax
public interface IHttpServer : IDisposableEx, IDisposable, IAsyncDisposable
Properties
IsStarted
Returns true if the server is started.
Declaration
bool IsStarted { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
Url
The URL on which the server listens.
Declaration
string Url { get; }
Property Value
| Type | Description |
|---|---|
| String |
Methods
Start()
Starts the server.
Declaration
void Start()
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | The server has already been started. |
Stop()
Stops the server.
Declaration
void Stop()
Remarks
This method should not free resources so the already started sessions can gracefully terminate.
WaitForSessionAsync(CancellationToken)
If the server is listening, this method waits until a new request is availbale.
Declaration
Task<IHttpSession> WaitForSessionAsync(CancellationToken cancellation)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellation |
Returns
| Type | Description |
|---|---|
| Task<IHttpSession> |
Remarks
It's safe to call this method parallelly.
Exceptions
| Type | Condition |
|---|---|
| OperationCanceledException | Either the server was stopped or a |