Interface IChannel
Channel object. Use CreateChannel(IChannelTokenProvider) to construct one. This object allows the subscription to a channel.
Namespace: Unity.Services.Wire.Internal
Syntax
public interface IChannel : IDisposableMethods
SubscribeAsync()
SubscribeAsync will subscribe to the channel. Possible error codes are:
- 23002 -> "CommandFailed"
- 23003 -> "ConnectionFailed"
- 23004 -> "InvalidToken"
- 23005 -> "InvalidChannelName"
- 23006 -> "TokenRetrieverFailed"
- 23007 -> "Unauthorized"
- 23008 -> "AlreadySubscribed"
Declaration
Task SubscribeAsync()Returns
| Type | Description | 
|---|---|
| Task | An awaitable task. | 
UnsubscribeAsync()
UnsubscribeAsync will stop the subscription, effective immediately. Possible error codes are:
- 23002 -> "CommandFailed"
- 23009 -> "AlreadyUnsubscribed"
Declaration
Task UnsubscribeAsync()Returns
| Type | Description | 
|---|---|
| Task | An awaitable task. | 
Events
BinaryMessageReceived
Handler called each time the channel receives a binary message.
Declaration
event Action<byte[]> BinaryMessageReceivedEvent Type
| Type | Description | 
|---|---|
| Action<Byte[]> | 
ErrorReceived
Handler called whenever the subscription encounters an error. A description of the error is passed as an argument.
Declaration
event Action<string> ErrorReceivedEvent Type
| Type | Description | 
|---|---|
| Action<String> | 
KickReceived
Handler called if the subscription gets terminated by the Wire server.
Declaration
event Action KickReceivedEvent Type
| Type | Description | 
|---|---|
| Action | 
MessageReceived
Handler called each time the channel receives a message.
Declaration
event Action<string> MessageReceivedEvent Type
| Type | Description | 
|---|---|
| Action<String> | 
NewStateReceived
Handler called whenever the subscription reliability changes.
Declaration
event Action<SubscriptionState> NewStateReceivedEvent Type
| Type | Description | 
|---|---|
| Action<SubscriptionState> |