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
object
ProxyBase
Implements
System.IDisposable

Constructors

View Source

ProxyBase()

Creates a new instance of the ProxyBase class.

Declaration
C#
Copy
public ProxyBase()
Exceptions
Type Condition
InvalidIOException

Thrown when an internal I/O error occurs during initialization.

Properties

View Source

CallbackPort

Gets Port object for asynchronous events.

Declaration
C#
Copy
protected Port CallbackPort { get; }
Property Value
Type Description
Port
View Source

Port

Gets Port object.

Declaration
C#
Copy
protected Port Port { get; }
Property Value
Type Description
Port

Methods

View Source

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
InvalidIDException

Thrown if the specified application ID does not exist.

InvalidIOException

Thrown in case of an internal input/output error during the connection process.

PermissionDeniedException

Thrown when the required privileges are missing or access is otherwise restricted.

View Source

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
InvalidIDException

Thrown if the specified application ID does not exist.

InvalidIOException

Thrown in case of an internal input/output error during the connection process.

PermissionDeniedException

Thrown when the required privileges are missing or access is otherwise restricted.

View Source

Dispose()

Release all resources used by the class ProxyBase.

Declaration
C#
Copy
public void Dispose()
View Source

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.

View Source

~ProxyBase()

Finalizer of the class ProxyBase.

Declaration
C#
Copy
protected ~ProxyBase()
View Source

GetPort(Type)

Retrieves a port based on its type.

Declaration
C#
Copy
protected Port GetPort(Port.Type t)
Parameters
Type Name Description
Port.Type t

The specific type of port to retrieve.

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
InvalidIOException

Thrown if an internal I/O error occurs while retrieving the port.

View Source

OnConnectedEvent(string, string, Port)

Abstract method for receiving connected event.

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.

View Source

OnDisconnectedEvent(string, string)

Abstract method for receiving disconnected event.

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.

View Source

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.

View Source

OnRejectedEvent(string, string)

Abstract method for receiving rejected event.

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.

Implements

System.IDisposable