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 : IDisposable
Methods
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[]> BinaryMessageReceived
Event 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> ErrorReceived
Event Type
Type | Description |
---|---|
Action<String> |
KickReceived
Handler called if the subscription gets terminated by the Wire server.
Declaration
event Action KickReceived
Event Type
Type | Description |
---|---|
Action |
MessageReceived
Handler called each time the channel receives a message.
Declaration
event Action<string> MessageReceived
Event Type
Type | Description |
---|---|
Action<String> |
NewStateReceived
Handler called whenever the subscription reliability changes.
Declaration
event Action<SubscriptionState> NewStateReceived
Event Type
Type | Description |
---|---|
Action<SubscriptionState> |