Class ProxyBase
Definition
- Namespace:
- Tizen.Applications.RPCPort
- Assembly:
- Tizen.Applications.Common.dll
Base class for creating a proxy class for remote procedure calls.
public abstract class ProxyBase : IDisposable
- Inheritance
-
objectProxyBase
- Implements
-
System.IDisposable
Constructors
View SourceProxyBase()
Creates a new instance of the ProxyBase class.
Declaration
public ProxyBase()
Exceptions
Type | Condition |
---|---|
InvalidIOException | Thrown when an internal I/O error occurs during initialization. |
Properties
View SourceCallbackPort
Gets Port object for asynchronous events.
Declaration
protected Port CallbackPort { get; }
Property Value
Type | Description |
---|---|
Port |
Port
Gets Port object.
Declaration
protected Port Port { get; }
Property Value
Type | Description |
---|---|
Port |
Methods
View SourceConnect(string, string)
Establishes a connection to the specified application through the named remote procedure call (RPC) port.
Declaration
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. |
ConnectSync(string, string)
Establishes a connection to the specified application synchronously through the named remote procedure call (RPC) port.
Declaration
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. |
Dispose()
Release all resources used by the class ProxyBase.
Declaration
public void Dispose()
Dispose(bool)
Releases any unmanaged resources used by this object and disposes any other disposable objects.
Declaration
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. |
~ProxyBase()
Finalizer of the class ProxyBase.
Declaration
protected ~ProxyBase()
GetPort(Type)
Retrieves a port based on its type.
Declaration
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:
Port mainPort = GetPort(Port.Type.Main);
Exceptions
Type | Condition |
---|---|
InvalidIOException | Thrown if an internal I/O error occurs while retrieving the port. |
OnConnectedEvent(string, string, Port)
Abstract method for receiving connected event.
Declaration
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. |
OnDisconnectedEvent(string, string)
Abstract method for receiving disconnected event.
Declaration
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
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. |
OnRejectedEvent(string, string)
Abstract method for receiving rejected event.
Declaration
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. |