Class ServerBase

    Definition

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

    An abstract class to represent cion server.

    public abstract class ServerBase : IDisposable
    Inheritance
    object
    ServerBase

    Constructors

    View Source

    ServerBase(string, string, SecurityInfo)

    The constructor of ServerBase class.

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

    The name of service.

    string displayName

    The display name of service.

    SecurityInfo security

    The security configuration.

    Remarks

    The maximum length of service name is 512.

    View Source

    ServerBase(string, string)

    The constructor of ServerBase class.

    Declaration
    public ServerBase(string serviceName, string displayName)
    Parameters
    Type Name Description
    string serviceName

    The name of service.

    string displayName

    The display name of service.

    Remarks

    The maximum length of service name is 512.

    Properties

    View Source

    DisplayName

    Gets or sets the display name of current cion server.

    Declaration
    public string DisplayName { get; set; }
    Property Value
    Type Description
    string
    View Source

    ServiceName

    Gets the service name of current cion server.

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

    Methods

    View Source

    Accept(PeerInfo)

    Accepts the connection request from the peer.

    Declaration
    public void Accept(PeerInfo peerInfo)
    Parameters
    Type Name Description
    PeerInfo peerInfo

    The peer to accept the connection request.

    View Source

    Disconnect(PeerInfo)

    Disconnects with the peer.

    Declaration
    public void Disconnect(PeerInfo peerInfo)
    Parameters
    Type Name Description
    PeerInfo peerInfo

    The peer to disconnect.

    View Source

    Dispose()

    Releases all resources used by the ServerBase 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

    GetConnectedPeerList()

    Gets connected peers.

    Declaration
    public IEnumerable<PeerInfo> GetConnectedPeerList()
    Returns
    Type Description
    IEnumerable<><PeerInfo>
    View Source

    Listen()

    Starts server and listens for requests from cion clients.

    Declaration
    public void Listen()
    View Source

    OnConnectionRequest(PeerInfo)

    The callback invoked when connection requested from the cion client.

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

    The peer info of the cion client.

    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 client.

    ConnectionResult result

    The result of the connection.

    View Source

    OnDataReceived(byte[], PeerInfo)

    The callback invoked when received data.

    Declaration
    protected abstract byte[] OnDataReceived(byte[] data, PeerInfo peerInfo)
    Parameters
    Type Name Description
    byte[] data

    The received data.

    PeerInfo peerInfo

    The peer info of the cion client.

    Returns
    Type Description
    byte[]
    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 client.

    View Source

    OnPayloadReceived(Payload, PeerInfo, PayloadTransferStatus)

    The callback invoked when received payload.

    Declaration
    protected abstract void OnPayloadReceived(Payload data, PeerInfo peerInfo, PayloadTransferStatus status)
    Parameters
    Type Name Description
    Payload data

    The received data.

    PeerInfo peerInfo

    The peer info of the cion client.

    PayloadTransferStatus status

    The status of payload transfer.

    View Source

    Reject(PeerInfo, string)

    Rejects the connection request from the peer.

    Declaration
    public void Reject(PeerInfo peerInfo, string reason)
    Parameters
    Type Name Description
    PeerInfo peerInfo

    The peer to reject the connection request.

    string reason

    The reason why reject the connection request.

    View Source

    SendPayloadAsync(Payload, PeerInfo)

    Sends the payload to a peer asynchronously.

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

    The payload to send.

    PeerInfo peerInfo

    The peer to send payload.

    Returns
    Type Description
    Task<><PayloadAsyncResult>
    View Source

    SendPayloadAsync(Payload)

    Sends the payload to all of connected peer asynchronously.

    Declaration
    public void SendPayloadAsync(Payload payload)
    Parameters
    Type Name Description
    Payload payload

    The payload to send.

    View Source

    SetOndemandLaunchEnabled(bool)

    Sets ondemand launch enabled flag.

    Declaration
    public void SetOndemandLaunchEnabled(bool enable)
    Parameters
    Type Name Description
    bool enable

    Whether ondemand launch is enabled or not.

    View Source

    Stop()

    Stops the listen operation.

    Declaration
    public void Stop()

    Extension Methods

    EXamlExtensions.LoadFromEXamlByRelativePath<T>(T, string)
    Extensions.LoadFromXaml<TXaml>(TXaml, string)
    Extensions.LoadFromXaml<TXaml>(TXaml, Type)
    Extensions.LoadFromXamlFile<TXaml>(TXaml, string)
    • View Source
    Back to top Copyright © 2016-2025 Samsung
    Generated by DocFX