Class RequestListener<TContract>
Represents a communication listener for receiving service requests.
Inheritance
Namespace: Copper.Remoting.Service
Assembly: Copper.Remoting.Service.dll
Syntax
public class RequestListener<TContract> : ICommunicationListener where TContract : class
Type Parameters
| Name | Description |
|---|---|
| TContract |
Constructors
View SourceRequestListener(IRequestReceiver, TContract)
Initializes a new instance of the RequestListener<TContract> class.
Declaration
public RequestListener(IRequestReceiver requestReceiver, TContract serviceImplementation)
Parameters
| Type | Name | Description |
|---|---|---|
| IRequestReceiver | requestReceiver | The request receiver. |
| TContract | serviceImplementation | The service implementation. |
Methods
View SourceAbort()
This method causes the communication listener to close. Close is a terminal state and this method causes the transition to close ungracefully. Any outstanding operations (including close) should be canceled when this method is called.
Declaration
public void Abort()
CloseAsync(CancellationToken)
This method causes the communication listener to close. Close is a terminal state and this method allows the communication listener to transition to this state in a graceful manner.
Declaration
public Task CloseAsync(CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | A System.Threading.Tasks.Task that represents outstanding operation. |
OpenAsync(CancellationToken)
This method causes the communication listener to be opened. Once the Open completes, the communication listener becomes usable - accepts and sends messages.
Declaration
public Task<string> OpenAsync(CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.String> | A System.Threading.Tasks.Task that represents outstanding operation. The result of the Task is the endpoint string. |