Class ServerBase

Definition

Namespace:
Tizen.Applications.Cion
Assembly:
Tizen.Applications.Cion.dll
API Level:
9

An abstract class to represent cion server.

C#
Copy
public abstract class ServerBase : IDisposable
Inheritance
ServerBase

Constructors

View Source

ServerBase(String, String)

The constructor of ServerBase class.

Declaration
C#
Copy
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.

API Level: 9
View Source

ServerBase(String, String, SecurityInfo)

The constructor of ServerBase class.

Declaration
C#
Copy
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.

API Level: 9

Properties

View Source

DisplayName

Gets or sets the display name of current cion server.

Declaration
C#
Copy
public string DisplayName { get; set; }
Property Value
Type Description
String
API Level: 9
View Source

ServiceName

Gets the service name of current cion server.

Declaration
C#
Copy
public string ServiceName { get; }
Property Value
Type Description
String
API Level: 9

Methods

View Source

Accept(PeerInfo)

Accepts the connection request from the peer.

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

The peer to accept the connection request.

API Level: 9
View Source

Disconnect(PeerInfo)

Disconnects with the peer.

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

The peer to disconnect.

API Level: 9
View Source

Dispose()

Releases all resources used by the ServerBase class.

Declaration
C#
Copy
public void Dispose()
API Level: 9
View Source

Dispose(Boolean)

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

Declaration
C#
Copy
protected virtual void Dispose(bool disposing)
Parameters
Type Name Description
Boolean disposing

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

API Level: 9
View Source

GetConnectedPeerList()

Gets connected peers.

Declaration
C#
Copy
public IEnumerable<PeerInfo> GetConnectedPeerList()
Returns
Type Description
IEnumerable<PeerInfo>
API Level: 9
View Source

Listen()

Starts server and listens for requests from cion clients.

Declaration
C#
Copy
public void Listen()
API Level: 9
Privilege Level: public
Privilege: http://tizen.org/privilege/d2d.datasharinghttp://tizen.org/privilege/internet
View Source

OnConnectionRequest(PeerInfo)

The callback invoked when connection requested from the cion client.

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

The peer info of the cion client.

API Level: 9
View Source

OnConnectionResult(PeerInfo, ConnectionResult)

The result callback of connection request.

Declaration
C#
Copy
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.

API Level: 9
View Source

OnDataReceived(Byte[], PeerInfo)

The callback invoked when received data.

Declaration
C#
Copy
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[]
API Level: 9
View Source

OnDisconnected(PeerInfo)

The callback invoked when disconnected with cion client.

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

The peer info of the cion client.

API Level: 9
View Source

OnPayloadReceived(Payload, PeerInfo, PayloadTransferStatus)

The callback invoked when received payload.

Declaration
C#
Copy
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.

API Level: 9
View Source

Reject(PeerInfo, String)

Rejects the connection request from the peer.

Declaration
C#
Copy
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.

API Level: 9
View Source

SendPayloadAsync(Payload)

Sends the payload to all of connected peer asynchronously.

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

The payload to send.

API Level: 9
View Source

SendPayloadAsync(Payload, PeerInfo)

Sends the payload to a peer asynchronously.

Declaration
C#
Copy
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>
API Level: 9
View Source

SetOndemandLaunchEnabled(Boolean)

Sets ondemand launch enabled flag.

Declaration
C#
Copy
public void SetOndemandLaunchEnabled(bool enable)
Parameters
Type Name Description
Boolean enable

Whether ondemand launch is enabled or not.

API Level: 9
Privilege Level: public
Privilege: http://tizen.org/privilege/d2d.remotelaunch
View Source

Stop()

Stops the listen operation.

Declaration
C#
Copy
public void Stop()
API Level: 9

Extension Methods