Class ClientBase

    Definition

    Namespace:
    Tizen.Applications.Cion
    Assembly:
    Tizen.Applications.Cion.dll

    An abstract class to represent cion client.

    public abstract class ClientBase : IDisposable
    Inheritance
    object
    ClientBase
    Implements
    System.IDisposable

    Constructors

    View Source

    ClientBase(string, SecurityInfo)

    The constructor of ClientBase class.

    Declaration
    public ClientBase(string serviceName, SecurityInfo security)
    Parameters
    Type Name Description
    string serviceName

    The name of service.

    SecurityInfo security

    The security configuration.

    Remarks

    The maximum length of service name is 512.

    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when the given service name is too long.

    System.InvalidOperationException

    Thrown when there is not enough memory to continue the execution of the method.

    View Source

    ClientBase(string)

    The constructor of ClientBase class.

    Declaration
    public ClientBase(string serviceName)
    Parameters
    Type Name Description
    string serviceName

    The name of service.

    Remarks

    The maximum length of service name is 512.

    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when the given service name is too long.

    System.InvalidOperationException

    Thrown when there is not enough memory to continue the execution of the method.

    Properties

    View Source

    PeerInfo

    Gets peer info of connected cion server.

    Declaration
    public PeerInfo PeerInfo { get; }
    Property Value
    Type Description
    PeerInfo
    View Source

    ServiceName

    Gets the service name of current cion client.

    Declaration
    public string ServiceName { get; }
    Property Value
    Type Description
    string

    Methods

    View Source

    Connect(PeerInfo)

    Connects with the cion server.

    Declaration
    public void Connect(PeerInfo peer)
    Parameters
    Type Name Description
    PeerInfo peer

    The peer to connect.

    Exceptions
    Type Condition
    System.InvalidOperationException

    Thrown when the client cannot connect to server.

    System.UnauthorizedAccessException

    Thrown when an application does not have the privilege to access this method.

    View Source

    Disconnect()

    Disconnects from the cion server.

    Declaration
    public void Disconnect()
    View Source

    Dispose()

    Releases all resources used by the ClientBase class.

    Declaration
    public void Dispose()
    View Source

    Dispose(bool)

    Releases any unmanaged resources used by this object. Can also dispose any other disposable objects.

    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

    OnConnectionResult(PeerInfo, ConnectionResult)

    The result callback of connection request.

    Declaration
    protected abstract void OnConnectionResult(PeerInfo peerInfo, ConnectionResult result)
    Parameters
    Type Name Description
    PeerInfo peerInfo

    The peer info of the cion server.

    ConnectionResult result

    The result of the connection.

    View Source

    OnDisconnected(PeerInfo)

    The callback invoked when disconnected with cion client.

    Declaration
    protected abstract void OnDisconnected(PeerInfo peerInfo)
    Parameters
    Type Name Description
    PeerInfo peerInfo

    The peer info of the cion server.

    View Source

    OnDiscovered(PeerInfo)

    The callback invoked when the cion server discovered.

    Declaration
    protected abstract void OnDiscovered(PeerInfo peerInfo)
    Parameters
    Type Name Description
    PeerInfo peerInfo

    The peer info of discovered cion server.

    View Source

    OnPayloadReceived(Payload, PayloadTransferStatus)

    The callback invoked when received payload.

    Declaration
    protected abstract void OnPayloadReceived(Payload payload, PayloadTransferStatus status)
    Parameters
    Type Name Description
    Payload payload

    The received payload.

    PayloadTransferStatus status

    The status of sent payload.

    View Source

    SendData(byte[], int)

    Sends data synchronously to the connected cion server.

    Declaration
    public byte[] SendData(byte[] data, int timeout)
    Parameters
    Type Name Description
    byte[] data

    The data to send.

    int timeout

    The timeout of sending operation.

    Returns
    Type Description
    byte[]
    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when the given data is invalid.

    System.InvalidOperationException

    Thrown when there is no connected cion server or failed to receive reply.

    System.TimeoutException

    Thrown when a timeout occurred.

    View Source

    SendPayloadAsync(Payload)

    Sends payload asynchronously to the connected cion server.

    Declaration
    public Task<PayloadAsyncResult> SendPayloadAsync(Payload payload)
    Parameters
    Type Name Description
    Payload payload

    The payload to send.

    Returns
    Type Description
    System.Threading.Tasks.Task<TResult><PayloadAsyncResult>
    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when the payload is not valid.

    System.InvalidOperationException

    Thrown when there is no connected cion server or failed to send payload.

    View Source

    StopDiscovery()

    Stops discovering.

    Declaration
    public void StopDiscovery()
    Exceptions
    Type Condition
    System.InvalidOperationException

    Thrown when the client is not discovering.

    View Source

    TryDiscovery()

    Starts discovering cion servers.

    Declaration
    public void TryDiscovery()
    Exceptions
    Type Condition
    System.InvalidOperationException

    Thrown when the discovery operation is already in progress.

    System.UnauthorizedAccessException

    Thrown when an application does not have the privilege to access this method.

    Implements

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