Class ServerBase
Definition
- Namespace:
- Tizen.Applications.Cion
- Assembly:
- Tizen.Applications.Cion.dll
- API Level:
- 9
An abstract class to represent cion server.
C#Copypublic abstract class ServerBase : IDisposable
- Inheritance
-
System.ObjectServerBase
- Implements
-
System.IDisposable
Constructors
Declaration
C#Copypublic ServerBase(string serviceName, string displayName)
Parameters
Type | Name | Description |
---|---|---|
System.String | serviceName | The name of service. |
System.String | displayName | The display 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. |
API Level: 9
Declaration
C#Copypublic ServerBase(string serviceName, string displayName, SecurityInfo security)
Parameters
Type | Name | Description |
---|---|---|
System.String | serviceName | The name of service. |
System.String | displayName | The display 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. |
API Level: 9
Properties
Declaration
C#Copypublic string DisplayName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
API Level: 9
Declaration
C#Copypublic string ServiceName { get; }
Property Value
Type | Description |
---|---|
System.String |
API Level: 9
Methods
Declaration
C#Copypublic void Accept(PeerInfo peerInfo)
Parameters
Type | Name | Description |
---|---|---|
PeerInfo | peerInfo | The peer to accept the connection request. |
API Level: 9
Declaration
C#Copypublic void Disconnect(PeerInfo peerInfo)
Parameters
Type | Name | Description |
---|---|---|
PeerInfo | peerInfo | The peer to disconnect. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when the given peer info is invalid. |
API Level: 9
Declaration
C#Copypublic void Dispose()
API Level: 9
Dispose(Boolean)
Releases any unmanaged resources used by this object. Can also dispose any other disposable objects.
Declaration
C#Copyprotected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | If true, disposes any disposable objects. If false, does not dispose disposable objects. |
API Level: 9
Declaration
C#Copypublic IEnumerable<PeerInfo> GetConnectedPeerList()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<PeerInfo> |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Thrown when there is not enough memory to continue the execution of the method. |
API Level: 9
Declaration
C#Copypublic void Listen()
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Thrown when the listen operation is already in progress. |
UnauthorizedAccessException | Thrown when an application does not have the privilege to access this method. |
API Level: 9
Privilege Level: public
Privilege: http://tizen.org/privilege/d2d.datasharinghttp://tizen.org/privilege/internet
OnConnectionRequest(PeerInfo)
The callback invoked when connection requested from the cion client.
Declaration
C#Copyprotected abstract void OnConnectionRequest(PeerInfo peerInfo)
Parameters
Type | Name | Description |
---|---|---|
PeerInfo | peerInfo | The peer info of the cion client. |
API Level: 9
OnConnectionResult(PeerInfo, ConnectionResult)
The result callback of connection request.
Declaration
C#Copyprotected 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
Declaration
C#Copyprotected abstract byte[] OnDataReceived(byte[] data, PeerInfo peerInfo)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | data | The received data. |
PeerInfo | peerInfo | The peer info of the cion client. |
Returns
Type | Description |
---|---|
System.Byte[] |
API Level: 9
Declaration
C#Copyprotected abstract void OnDisconnected(PeerInfo peerInfo)
Parameters
Type | Name | Description |
---|---|---|
PeerInfo | peerInfo | The peer info of the cion client. |
API Level: 9
OnPayloadReceived(Payload, PeerInfo, PayloadTransferStatus)
The callback invoked when received payload.
Declaration
C#Copyprotected 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
Declaration
C#Copypublic void Reject(PeerInfo peerInfo, string reason)
Parameters
Type | Name | Description |
---|---|---|
PeerInfo | peerInfo | The peer to reject the connection request. |
System.String | reason | The reason why reject the connection request. |
API Level: 9
Declaration
C#Copypublic void SendPayloadAsync(Payload payload)
Parameters
Type | Name | Description |
---|---|---|
Payload | payload | The payload to send. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when the payload is not valid. |
System.InvalidOperationException | Thrown when failed to send payload. |
API Level: 9
Declaration
C#Copypublic 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 |
---|---|
System.Threading.Tasks.Task<PayloadAsyncResult> |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when the payload is not valid. |
System.InvalidOperationException | Thrown when there is no such connected cion client or failed to send payload. |
API Level: 9
Declaration
C#Copypublic void SetOndemandLaunchEnabled(bool enable)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | enable | Whether ondemand launch is enabled or not. |
Exceptions
Type | Condition |
---|---|
UnauthorizedAccessException | Thrown when an application does not have the privilege to access this method. |
API Level: 9
Privilege Level: public
Privilege: http://tizen.org/privilege/d2d.remotelaunch
Declaration
C#Copypublic void Stop()
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Thrown when the server is not listening. |