Class ProxyBase
Definition
- Namespace:
- Tizen.Applications.RPCPort
- Assembly:
- Tizen.Applications.Common.dll
Base class for creating a proxy class for remote procedure calls.
C#
Copy
public abstract class ProxyBase : IDisposable
- Inheritance
-
objectProxy
Base
- Implements
-
System.
IDisposable
Constructors
Declaration
C#
Copy
public ProxyBase()
Exceptions
Type | Condition |
---|---|
Invalid |
Thrown when an internal I/O error occurs during initialization. |
Properties
Declaration
C#
Copy
protected Port CallbackPort { get; }
Property Value
Type | Description |
---|---|
Port |
Declaration
C#
Copy
protected Port Port { get; }
Property Value
Type | Description |
---|---|
Port |
Methods
Connect(string, string)
Establishes a connection to the specified application through the named remote procedure call (RPC) port.
Declaration
C#
Copy
protected void Connect(string appid, string port)
Parameters
Type | Name | Description |
---|---|---|
string | appid | The ID of the target application to connect to. |
string | port | The name of the RPC port to use for the connection. |
Remarks
By calling this method, you can establish a connection between two applications using the specified RPC port. It requires the target application ID and the name of the desired RPC port. If the connection cannot be established due to invalid arguments or insufficient privileges, appropriate exceptions are thrown accordingly.
Exceptions
Type | Condition |
---|---|
Invalid |
Thrown if the specified application ID does not exist. |
Invalid |
Thrown in case of an internal input/output error during the connection process. |
Permission |
Thrown when the required privileges are missing or access is otherwise restricted. |
ConnectSync(string, string)
Establishes a connection to the specified application synchronously through the named remote procedure call (RPC) port.
Declaration
C#
Copy
protected void ConnectSync(string appid, string port)
Parameters
Type | Name | Description |
---|---|---|
string | appid | The ID of the target application to connect to. |
string | port | The name of the RPC port to use for the connection. |
Exceptions
Type | Condition |
---|---|
Invalid |
Thrown if the specified application ID does not exist. |
Invalid |
Thrown in case of an internal input/output error during the connection process. |
Permission |
Thrown when the required privileges are missing or access is otherwise restricted. |
Declaration
C#
Copy
public void Dispose()
Dispose(bool)
Releases any unmanaged resources used by this object and disposes any other disposable objects.
Declaration
C#
Copy
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
bool | disposing | true to disposes any disposable objects, or false not to dispose disposable objects. |
Declaration
C#
Copy
protected ~ProxyBase()
Declaration
C#
Copy
protected Port GetPort(Port.Type t)
Parameters
Returns
Type | Description |
---|---|
Port | An object representing the requested port. |
Examples
To get a main port:
Copy
Port mainPort = GetPort(Port.Type.Main);
Exceptions
Type | Condition |
---|---|
Invalid |
Thrown if an internal I/O error occurs while retrieving the port. |
Declaration
C#
Copy
protected abstract void OnConnectedEvent(string endPoint, string portName, Port port)
Parameters
Type | Name | Description |
---|---|---|
string | endPoint | The target stub application ID. |
string | portName | The name of the Remote Procedure Call (RPC) port. |
Port | port | Port object for reading and writing. |
Declaration
C#
Copy
protected abstract void OnDisconnectedEvent(string endPoint, string portName)
Parameters
Type | Name | Description |
---|---|---|
string | endPoint | The target stub application ID.. |
string | portName | The name of the Remote Procedure Call (RPC) port. |
OnReceivedEvent(string, string)
Abstract method called when the proxy receives data from stub.
Declaration
C#
Copy
protected abstract void OnReceivedEvent(string endPoint, string portName)
Parameters
Type | Name | Description |
---|---|---|
string | endPoint | The target stub application ID.. |
string | portName | The name of the Remote Procedure Call (RPC) port. |
Declaration
C#
Copy
protected abstract void OnRejectedEvent(string endPoint, string portName)
Parameters
Type | Name | Description |
---|---|---|
string | endPoint | The target stub application ID.. |
string | portName | The name of the Remote Procedure Call (RPC) port. |