Class ComponentPort
Definition
- Namespace:
- Tizen.Applications.ComponentBased
- Assembly:
- Tizen.Applications.ComponentBased.Port.dll
- API Level:
- 9
The component port API provides functions to send and receive requests between components of component-based-application.
C#Copypublic class ComponentPort : IDisposable
- Inheritance
-
ComponentPort
Constructors
Declaration
C#Copypublic ComponentPort(string portName)
Parameters
Type | Name | Description |
---|---|---|
String | portName | The name of the port. |
API Level: 9
Properties
Declaration
C#Copypublic string PortName { get; }
Property Value
Type | Description |
---|---|
String |
API Level: 9
Methods
Declaration
C#Copypublic void AddPrivilege(string privilege)
Parameters
Type | Name | Description |
---|---|---|
String | privilege | privilege data |
API Level: 9
Declaration
C#Copypublic void Cancel()
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 |
---|---|---|
Boolean | disposing | If true, disposes any disposable objects, or false not to dispose disposable objects. |
API Level: 9
Declaration
C#Copyprotected void Finalize()
API Level: 9
Declaration
C#Copypublic void Send(string endpoint, int timeout, object request)
Parameters
Type | Name | Description |
---|---|---|
String | endpoint | The name of the endpoint |
Int32 | timeout | The timeout in milliseconds, -1 to use the default timeout |
Object | request | The serializable data to send |
API Level: 9
SendAndReceive(String, Int32, Object)
Sends the request data and receives the reply data.
Declaration
C#Copypublic object SendAndReceive(string endpoint, int timeout, object request)
Parameters
Type | Name | Description |
---|---|---|
String | endpoint | The name of the endpoint |
Int32 | timeout | The timeout in milliseconds, -1 to use the default timeout |
Object | request | The serializable data to send |
Returns
Type | Description |
---|---|
Object | The received serializable data |
API Level: 9
SendAndReceiveAsync(String, Int32, Object)
Sends the request data and receives the reply data asynchronously.
Declaration
C#Copypublic Task<object> SendAndReceiveAsync(string endpoint, int timeout, object request)
Parameters
Type | Name | Description |
---|---|---|
String | endpoint | The name of the endpoint |
Int32 | timeout | The timeout in milliseconds, -1 to use the default timeout |
Object | request | The serializable data to send |
Returns
Type | Description |
---|---|
Task<Object> | The received serializable data |
API Level: 9
Declaration
C#Copypublic void WaitForEvent()
Remarks
This method runs a main loop until Cancel() is called. The code in the next line will not run until Cancel() is called. To avoid blocking the main thread, it's recommended to use the ComponentTask class.
Examples
CopyComponentTask task = new ComponentTask(new ComponentPort("Comm")); task.Start();
API Level: 9
Declaration
C#Copypublic static Task WaitForPort(string endpoint)
Parameters
Type | Name | Description |
---|---|---|
String | endpoint | The name of the port |
Returns
Type | Description |
---|---|
Task | A task. |
Events
Declaration
C#Copypublic event EventHandler<RequestEventArgs> RequestReceived
Event Type
Type | Description |
---|---|
EventHandler<RequestEventArgs> |
Remarks
If the reply is requested, RequestEventArgs.Request should be set.