Class WebService
Implements a general Web Service over HTTP.
Inherited Members
Solti.Utils.Primitives.Patterns.Disposable.BeforeDispose()
Solti.Utils.Primitives.Patterns.Disposable.CheckNotDisposed()
Solti.Utils.Primitives.Patterns.Disposable.Dispose()
Solti.Utils.Primitives.Patterns.Disposable.DisposeAsync()
Solti.Utils.Primitives.Patterns.Disposable.Disposed
Namespace: Solti.Utils.Rpc
Assembly: Solti.Utils.Rpc.Server.dll
Syntax
public class WebService : Disposable, IDisposableEx, IDisposable, IAsyncDisposable
Constructors
WebService(IDiProvider, CancellationToken)
Creates a new WebService instance.
Declaration
public WebService(IDiProvider diProvider, CancellationToken cancellation)
Parameters
Type | Name | Description |
---|---|---|
IDiProvider | diProvider | |
CancellationToken | cancellation |
Properties
HttpServer
The underlying IHttpServer implementation.
Declaration
protected IHttpServer HttpServer { get; }
Property Value
Type | Description |
---|---|
IHttpServer |
IsListening
Returns true if the server is listening.
Declaration
public bool IsListening { get; }
Property Value
Type | Description |
---|---|
Boolean |
IsStarted
returns true if the server is started.
Declaration
public bool IsStarted { get; }
Property Value
Type | Description |
---|---|
Boolean |
Logger
The logger associated with this instance.
Declaration
protected ILogger Logger { get; }
Property Value
Type | Description |
---|---|
ILogger |
Remarks
This logger belongs to the service itself, not intended to be used in worker threads.
MaxWorkers
The maximum number of worker threads.
Declaration
public int MaxWorkers { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
ScopeFactory
Returns the Solti.Utils.DI.Interfaces.IScopeFactory related to this instance.
Declaration
public IScopeFactory ScopeFactory { get; }
Property Value
Type | Description |
---|---|
Solti.Utils.DI.Interfaces.IScopeFactory |
Methods
AsyncDispose()
Declaration
protected override async ValueTask AsyncDispose()
Returns
Type | Description |
---|---|
ValueTask |
Overrides
Solti.Utils.Primitives.Patterns.Disposable.AsyncDispose()
Dispose(Boolean)
Declaration
protected override void Dispose(bool disposeManaged)
Parameters
Type | Name | Description |
---|---|---|
Boolean | disposeManaged |
Overrides
Solti.Utils.Primitives.Patterns.Disposable.Dispose(System.Boolean)
DoWork(Int32, CancellationToken)
Creates a new worker Task that waits for a new session then processes it.
Declaration
protected virtual async Task DoWork(int workerId, CancellationToken cancellation)
Parameters
Type | Name | Description |
---|---|---|
Int32 | workerId | |
CancellationToken | cancellation |
Returns
Type | Description |
---|---|
Task |
Start()
Starts the service.
Declaration
public Task Start()
Returns
Type | Description |
---|---|
Task |
Stop()
Stops the service.
Declaration
public async Task Stop()
Returns
Type | Description |
---|---|
Task |
Implements
Solti.Utils.Primitives.Patterns.IDisposableEx