Class RemotePort

Definition

Namespace:
Tizen.Applications.Messages
Assembly:
Tizen.Applications.MessagePort.dll

The RemotePort Class provides functions to get if the remote port is running and to get whether the remote port is registered or unregistered.

C#
Copy
public class RemotePort : IDisposable
Inheritance
object
RemotePort
Implements
System.IDisposable

Constructors

View Source

RemotePort(string, string, bool)

Constructor of the RemotePort class.

Declaration
C#
Copy
public RemotePort(string appId, string portName, bool trusted)
Parameters
Type Name Description
string appId

The Id of the remote application

string portName

The name of the remote message port

bool trusted

If true is the trusted message port of application, otherwise false

Examples
Copy
RemotePort remotePort = new RemotePort("org.tizen.example.messageport", "SenderPort", false);
Exceptions
Type Condition
System.ArgumentException

Thrown when appId is null or empty, when portName is null or empty

Properties

View Source

AppId

The AppId of the remote port

Declaration
C#
Copy
public string AppId { get; }
Property Value
Type Description
string

Return appid of RemotePort

View Source

PortName

The name of the remote message port

Declaration
C#
Copy
public string PortName { get; }
Property Value
Type Description
string

Return name of RemotePort

View Source

Trusted

If true the remote port is a trusted port, otherwise if false it is not

Declaration
C#
Copy
public bool Trusted { get; }
Property Value
Type Description
bool

Return true if RemotePort is trusted

Methods

View Source

Dispose()

Releases all resources used by the RemotePort class.

Declaration
C#
Copy
public void Dispose()
View Source

Dispose(bool)

Releases the unmanaged resources used by the RemotePort class specifying whether to perform a normal dispose operation.

Declaration
C#
Copy
protected virtual void Dispose(bool disposing)
Parameters
Type Name Description
bool disposing

true for a normal dispose operation; false to finalize the handle.

View Source

~RemotePort()

Destructor of the RemotePort class.

Declaration
C#
Copy
protected ~RemotePort()
View Source

IsRunning()

Check if the remote message port is running.

Declaration
C#
Copy
public bool IsRunning()
Returns
Type Description
bool

Return true if Remote Port is running

Examples
Copy
Remote remotePort = new RemotePort("org.tizen.example", "SenderPort", true); bool isRunning = remotePort.isRunning();
Exceptions
Type Condition
System.InvalidOperationException

Thrown when there is an I/O error

System.OutOfMemoryException

Thrown when out of memory.

Events

View Source

RemotePortStateChanged

Called when the remote port is registered or unregistered.

Declaration
C#
Copy
public event EventHandler<RemotePortStateChangedEventArgs> RemotePortStateChanged
Event Type
Type Description
System.EventHandler<TEventArgs><RemotePortStateChangedEventArgs>
Examples
Copy
Remote remotePort = new RemotePort("org.tizen.example", "SenderPort", true); remotePort.RemotePortStateChanged += RemotePortStateChangedCallback; static void RemotePortStateChangedCallback(object sender, RemotePortStateChangedEventArgs e) { switch (e.Status) { case State.Registered : Console.WriteLine("Remote Port Registered "); break; case State.Unregistered : Console.WriteLine("Remote Port Unregistered "); break; default : break; } }
Exceptions
Type Condition
System.InvalidOperationException

Thrown when there is an I/O error

System.OutOfMemoryException

Thrown when out of memory.

Implements

System.IDisposable