Class ChannelReceiver

    Definition

    Namespace:
    Tizen.Core
    Assembly:
    Tizen.Core.dll

    Represents the channel receiver used for inter-task communication.

    public class ChannelReceiver : IDisposable
    Inheritance
    object
    ChannelReceiver
    Implements
    System.IDisposable

    Methods

    View Source

    Dispose()

    Release any unmanaged resources used by this object.

    Declaration
    public void Dispose()
    View Source

    Dispose(bool)

    Release any unmanaged resources used by this object.

    Declaration
    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    bool disposing

    If true, disposes any disposable objects. If false, does not dispose disposable objects.

    View Source

    ~ChannelReceiver()

    Finalizes an instance of the ChannelReceiver class.

    Declaration
    protected ~ChannelReceiver()
    View Source

    Receive()

    Asynchronously receives the channel object from the sender.

    Declaration
    public Task<ChannelObject> Receive()
    Returns
    Type Description
    System.Threading.Tasks.Task<TResult><ChannelObject>

    The received channel object.

    Examples
    var channel = new Channel();
    var task = TizenCore.Find("Test");
    task.Send(async () => {
      try {
        var channelObject = await channel.Receiver.Receive();
        Console.WriteLine("Message = {}", (string)channelObject.Data);
      } catch (Exception e) {
        Console.Error.WriteLine("Failed to receive message: {0}", e.ToString());
      }
    });
    Exceptions
    Type Condition
    System.OutOfMemoryException

    Thrown when out of memory.

    System.InvalidOperationException

    Thrown when failed due to an invalid operation.

    Events

    View Source

    Received

    Occurs whenever a channel object is received in the main loop of the task.

    Declaration
    public event EventHandler<ChannelReceivedEventArgs> Received
    Event Type
    Type Description
    System.EventHandler<TEventArgs><ChannelReceivedEventArgs>
    Remarks

    The registered event handler will be invoked when the channel receiver is added to the specific task.

    Examples
    var channel = new Channel();
    var receiver = channel.Receiver;
    receiver.Received += (sender, args) => {
      Console.WriteLine("OnChannelObjectReceived. Message = {0}", (string)args.Data);
    };

    Implements

    System.IDisposable
    • View Source
    Back to top Copyright © 2016-2024 Samsung
    Generated by DocFX