Class StubBase
Definition
- Namespace:
- Tizen.Applications.RPCPort
- Assembly:
- Tizen.Applications.Common.dll
Base class for creating stubs in RPC.
public abstract class StubBase : IDisposable
- Inheritance
-
objectStubBase
- Implements
-
System.IDisposable
Remarks
This class provides a base implementation for creating stubs that are used in Remote Procedure Call (RPC). By extending this class, you can easily implement your own stubs for specific interfaces. The StubBase class handles common functionality such as managing the connection state and handling incoming requests from clients. It also provides methods for sending responses back to the client after processing the request. To create a stub for a specific interface, you need to extend the StubBase class and override its virtual methods according to the requirements of the interface.
Constructors
View SourceStubBase(string)
Constructs a new instance of the StubBase class.
Declaration
public StubBase(string portName)
Parameters
Type | Name | Description |
---|---|---|
string | portName | The name of the port that wants to listen. |
Remarks
This class provides a base implementation for creating stubs that are used in Remote Procedure Call (RPC). By extending this class, you can easily implement your own stubs for specific interfaces. The StubBase class handles common functionality such as managing the connection state and handling incoming requests from clients. It also provides methods for sending responses back to the client after processing the request. To create a stub for a specific interface, you need to extend the StubBase class and override its virtual methods according to the requirements of the interface.
Examples
Here's an example showing how to construct a new instance of the StubBase class:
// Create a new instance of the StubBase class
var stubBase = new StubBase("MyPort");
Exceptions
Type | Condition |
---|---|
InvalidIOException | Thrown when an internal IO error occurs. |
Properties
View SourcePortName
Gets port name.
Declaration
public string PortName { get; }
Property Value
Type | Description |
---|---|
string |
Remarks
This class provides a base implementation for creating stubs that are used in Remote Procedure Call (RPC). By extending this class, you can easily implement your own stubs for specific interfaces. The StubBase class handles common functionality such as managing the connection state and handling incoming requests from clients. It also provides methods for sending responses back to the client after processing the request. To create a stub for a specific interface, you need to extend the StubBase class and override its virtual methods according to the requirements of the interface.
Methods
View SourceAddPrivilege(string)
Adds a privilege to the stub.
Declaration
protected void AddPrivilege(string privilege)
Parameters
Type | Name | Description |
---|---|---|
string | privilege | The privilege to access this stub. |
Remarks
This class provides a base implementation for creating stubs that are used in Remote Procedure Call (RPC). By extending this class, you can easily implement your own stubs for specific interfaces. The StubBase class handles common functionality such as managing the connection state and handling incoming requests from clients. It also provides methods for sending responses back to the client after processing the request. To create a stub for a specific interface, you need to extend the StubBase class and override its virtual methods according to the requirements of the interface.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown when the privilege is null. |
Dispose()
Release all the resources used by the class StubBase.
Declaration
public void Dispose()
Remarks
This class provides a base implementation for creating stubs that are used in Remote Procedure Call (RPC). By extending this class, you can easily implement your own stubs for specific interfaces. The StubBase class handles common functionality such as managing the connection state and handling incoming requests from clients. It also provides methods for sending responses back to the client after processing the request. To create a stub for a specific interface, you need to extend the StubBase class and override its virtual methods according to the requirements of the interface.
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. |
Remarks
This class provides a base implementation for creating stubs that are used in Remote Procedure Call (RPC). By extending this class, you can easily implement your own stubs for specific interfaces. The StubBase class handles common functionality such as managing the connection state and handling incoming requests from clients. It also provides methods for sending responses back to the client after processing the request. To create a stub for a specific interface, you need to extend the StubBase class and override its virtual methods according to the requirements of the interface.
~StubBase()
Finalizer of the class StubBase.
Declaration
protected ~StubBase()
Remarks
This class provides a base implementation for creating stubs that are used in Remote Procedure Call (RPC). By extending this class, you can easily implement your own stubs for specific interfaces. The StubBase class handles common functionality such as managing the connection state and handling incoming requests from clients. It also provides methods for sending responses back to the client after processing the request. To create a stub for a specific interface, you need to extend the StubBase class and override its virtual methods according to the requirements of the interface.
GetPort(Type, string)
Retrieves a port based on its type and the connected instance.
Declaration
protected Port GetPort(Port.Type t, string instance)
Parameters
Type | Name | Description |
---|---|---|
Port.Type | t | The type of port to retrieve. |
string | instance | The ID of the instance that the port is connected to. |
Returns
Type | Description |
---|---|
Port | The requested port. |
Remarks
This class provides a base implementation for creating stubs that are used in Remote Procedure Call (RPC). By extending this class, you can easily implement your own stubs for specific interfaces. The StubBase class handles common functionality such as managing the connection state and handling incoming requests from clients. It also provides methods for sending responses back to the client after processing the request. To create a stub for a specific interface, you need to extend the StubBase class and override its virtual methods according to the requirements of the interface.
Exceptions
Type | Condition |
---|---|
InvalidIDException | Thrown if an invalid instance ID is passed. |
InvalidIOException | Thrown in case of an internal I/O error. |
Listen()
Starts listening to incoming connection requests on the specified port.
Declaration
protected void Listen()
Remarks
This method enables your application to listen for incoming connection requests from other applications. It is typically called after setting up the necessary network infrastructure such as creating a server socket and specifying a listening port.
Exceptions
Type | Condition |
---|---|
InvalidIOException | Thrown when an internal IO error occurs during the listening process. |
OnConnectedEvent(string, string)
Abstract method for receiving connected event.
Declaration
protected abstract void OnConnectedEvent(string sender, string instance)
Parameters
Type | Name | Description |
---|---|---|
string | sender | The target proxy applicstion ID. |
string | instance | The information about the request. |
Remarks
This class provides a base implementation for creating stubs that are used in Remote Procedure Call (RPC). By extending this class, you can easily implement your own stubs for specific interfaces. The StubBase class handles common functionality such as managing the connection state and handling incoming requests from clients. It also provides methods for sending responses back to the client after processing the request. To create a stub for a specific interface, you need to extend the StubBase class and override its virtual methods according to the requirements of the interface.
OnDisconnectedEvent(string, string)
Abstract method for receiving disconnected event.
Declaration
protected abstract void OnDisconnectedEvent(string sender, string instance)
Parameters
Type | Name | Description |
---|---|---|
string | sender | The target proxy applicstion ID. |
string | instance | The information about the request. |
Remarks
This class provides a base implementation for creating stubs that are used in Remote Procedure Call (RPC). By extending this class, you can easily implement your own stubs for specific interfaces. The StubBase class handles common functionality such as managing the connection state and handling incoming requests from clients. It also provides methods for sending responses back to the client after processing the request. To create a stub for a specific interface, you need to extend the StubBase class and override its virtual methods according to the requirements of the interface.
OnReceivedEvent(string, string, Port)
Abstract method called when the stub receives data from proxy.
Declaration
protected abstract bool OnReceivedEvent(string sender, string instance, Port port)
Parameters
Type | Name | Description |
---|---|---|
string | sender | The target proxy applicstion ID. |
string | instance | The information about the request. |
Port | port | Port object for reading and writing. |
Returns
Type | Description |
---|---|
bool |
|
Remarks
This class provides a base implementation for creating stubs that are used in Remote Procedure Call (RPC). By extending this class, you can easily implement your own stubs for specific interfaces. The StubBase class handles common functionality such as managing the connection state and handling incoming requests from clients. It also provides methods for sending responses back to the client after processing the request. To create a stub for a specific interface, you need to extend the StubBase class and override its virtual methods according to the requirements of the interface.
OnTerminatedEvent()
Abstract method called immediately before disposing an object.
Declaration
protected abstract void OnTerminatedEvent()
Remarks
This class provides a base implementation for creating stubs that are used in Remote Procedure Call (RPC). By extending this class, you can easily implement your own stubs for specific interfaces. The StubBase class handles common functionality such as managing the connection state and handling incoming requests from clients. It also provides methods for sending responses back to the client after processing the request. To create a stub for a specific interface, you need to extend the StubBase class and override its virtual methods according to the requirements of the interface.
SetTrusted(bool)
Sets whether the stub allows only trusted proxies or not.
Declaration
protected void SetTrusted(bool trusted)
Parameters
Type | Name | Description |
---|---|---|
bool | trusted | Indicates if the stub allows only trusted proxies or not. |
Remarks
This class provides a base implementation for creating stubs that are used in Remote Procedure Call (RPC). By extending this class, you can easily implement your own stubs for specific interfaces. The StubBase class handles common functionality such as managing the connection state and handling incoming requests from clients. It also provides methods for sending responses back to the client after processing the request. To create a stub for a specific interface, you need to extend the StubBase class and override its virtual methods according to the requirements of the interface.