4 <name>Tizen.Applications.MessagePort</name>
7 <member name="T:Tizen.Applications.Messages.MessagePort">
9 The message port API provides functions to send and receive messages between applications.
12 The message port API provides functions for passing messages between applications. An application should register its own local port to receive messages from remote applications.
13 If a remote application sends a message, the registered callback function of the local port is called.
14 The trusted message-port API allows communications between applications that are signed by the same developer(author) certificate.
17 <member name="M:Tizen.Applications.Messages.MessagePort.#ctor(System.String,System.Boolean)">
19 Initializes the instance of the MessagePort class.
21 <param name="portName">The name of the local message port.</param>
22 <param name="trusted">If true, it is the trusted message port of application, otherwise false.</param>
23 <exception cref="T:System.ArgumentException">Thrown when portName is null or empty.</exception>
25 MessagePort messagePort = new MessagePort("SenderPort", true);
28 <member name="M:Tizen.Applications.Messages.MessagePort.Finalize">
30 Destructor of the MessagePort class.
33 <member name="E:Tizen.Applications.Messages.MessagePort.MessageReceived">
35 Called when a message is received.
38 MessagePort messagePort = new MessagePort("SenderPort", true);
39 messagePort.MessageReceived += MessageReceivedCallback;
40 static void MessageReceivedCallback(object sender, MessageReceivedEventArgs e)
42 Console.WriteLine("Message Received ");
43 if (e.Remote.AppId != null) {
44 Console.WriteLine("from :"+e.Remote.AppId);
49 <member name="P:Tizen.Applications.Messages.MessagePort.PortName">
51 The name of the local message port.
54 <member name="P:Tizen.Applications.Messages.MessagePort.Trusted">
56 If true, the message port is a trusted port, otherwise false.
59 <member name="P:Tizen.Applications.Messages.MessagePort.Listening">
61 If true, the message port is listening, otherwise false.
64 <member name="M:Tizen.Applications.Messages.MessagePort.Listen">
66 Register the local message port.
68 <exception cref="T:System.InvalidOperationException">Thrown when portName is already used, when there is an I/O error.</exception>
69 <exception cref="T:System.ArgumentException">Thrown when there is an invalid parameter.</exception>
70 <exception cref="T:System.OutOfMemoryException">Thrown when out of memory.</exception>
72 MessagePort messagePort = new MessagePort("SenderPort", true);
73 messagePort.MessageReceived += MessageReceivedCallback;
77 <member name="M:Tizen.Applications.Messages.MessagePort.StopListening">
79 Unregisters the local message port.
81 <exception cref="T:System.InvalidOperationException">Thrown when messageport is already stopped, when there is an I/O error, when the port is not found.</exception>
82 <exception cref="T:System.ArgumentException">Thrown when there is an invalid parameter.</exception>
83 <exception cref="T:System.OutOfMemoryException">Thrown when out of memory.</exception>
85 MessagePort messagePort = new MessagePort("SenderPort", true);
86 messagePort.MessageReceived += MessageReceivedCallback;
88 using (var message = new Tizen.Application.Bundle())
90 message.AddItem("message", "a_string");
91 messagePort.Send(message, "ReceiverAppID", "ReceiverPort");
93 messagePort.StopListening();
96 <member name="M:Tizen.Applications.Messages.MessagePort.Send(Tizen.Applications.Bundle,System.String,System.String)">
98 Sends an untrusted message to the message port of a remote application.
100 <param name="message">The message to be passed to the remote application, the recommended message size is under 4KB.</param>
101 <param name="remoteAppId">The ID of the remote application.</param>
102 <param name="remotePortName">The name of the remote message port.</param>
103 <exception cref="T:System.InvalidOperationException">Thrown when there is an I/O error, when the port is not found.</exception>
104 <exception cref="T:System.ArgumentException">Thrown when there is an invalid parameter.</exception>
105 <exception cref="T:System.OutOfMemoryException">Thrown when out of memory.</exception>
106 <exception cref="T:System.ArgumentOutOfRangeException">Thrown when message has exceeded the maximum limit(4KB).</exception>
108 MessagePort messagePort = new MessagePort("SenderPort", true);
109 messagePort.MessageReceived += MessageReceivedCallback;
110 messagePort.Listen();
111 using (var message = new Tizen.Application.Bundle())
113 message.AddItem("message", "a_string");
114 messagePort.Send(message, "ReceiverAppID", "ReceiverPort");
118 <member name="M:Tizen.Applications.Messages.MessagePort.Send(Tizen.Applications.Bundle,System.String,System.String,System.Boolean)">
120 Sends a message to the message port of a remote application.
122 <param name="message">The message to be passed to the remote application, the recommended message size is under 4KB.</param>
123 <param name="remoteAppId">The ID of the remote application.</param>
124 <param name="remotePortName">The name of the remote message port.</param>
125 <param name="trusted">If true, it is the trusted message port of remote application, otherwise false.</param>
126 <exception cref="T:System.InvalidOperationException">Thrown when there is an I/O error, when the port is not found.</exception>
127 <exception cref="T:System.ArgumentException">Thrown when there is an invalid parameter.</exception>
128 <exception cref="T:System.OutOfMemoryException">Thrown when out of memory.</exception>
129 <exception cref="T:System.ArgumentOutOfRangeException">Thrown when message has exceeded the maximum limit(4KB).</exception>
130 <exception cref="T:System.UnauthorizedAccessException">Thrown when the remote application is not signed with the same certificate.</exception>
132 MessagePort messagePort = new MessagePort("SenderPort", true);
133 messagePort.MessageReceived += MessageReceivedCallback;
134 messagePort.Listen();
135 using (var message = new Tizen.Application.Bundle())
137 message.AddItem("message", "a_string");
138 messagePort.Send(message, "ReceiverAppID", "ReceiverPort", true);
142 <member name="M:Tizen.Applications.Messages.MessagePort.Dispose(System.Boolean)">
144 Releases the unmanaged resources used by the MessagePort class specifying whether to perform a normal dispose operation.
146 <param name="disposing">true for a normal dispose operation; false to finalize the handle.</param>
148 <member name="M:Tizen.Applications.Messages.MessagePort.Dispose">
150 Releases all resources used by the MessagePort class.
153 <member name="T:Tizen.Applications.Messages.MessageReceivedEventArgs">
155 An extended EventArgs class, which contains remote message port information and message.
158 <member name="P:Tizen.Applications.Messages.MessageReceivedEventArgs.Remote">
160 Contains AppId, port name, and trusted.
163 <member name="P:Tizen.Applications.Messages.MessageReceivedEventArgs.Message">
165 The message passed from the remote application.
168 <member name="T:Tizen.Applications.Messages.RemotePort">
170 The RemotePort Class provides functions to get if the remote port is running and to get whether the remote port is registered or unregistered.
172 <since_tizen> 4 </since_tizen>
174 <member name="M:Tizen.Applications.Messages.RemotePort.#ctor(System.String,System.String,System.Boolean)">
176 Constructor of the RemotePort class.
178 <since_tizen> 4 </since_tizen>
179 <param name="appId">The Id of the remote application</param>
180 <param name="portName">The name of the remote message port</param>
181 <param name="trusted">If true is the trusted message port of application, otherwise false</param>
182 <exception cref="T:System.ArgumentException">Thrown when appId is null or empty, when portName is null or empty</exception>
184 RemotePort remotePort = new RemotePort("org.tizen.example.messageport", "SenderPort", false);
187 <member name="M:Tizen.Applications.Messages.RemotePort.Finalize">
189 Destructor of the RemotePort class.
191 <since_tizen> 4 </since_tizen>
193 <member name="P:Tizen.Applications.Messages.RemotePort.AppId">
195 The AppId of the remote port
197 <since_tizen> 4 </since_tizen>
198 <returns> Return appid of RemotePort </returns>
200 <member name="P:Tizen.Applications.Messages.RemotePort.PortName">
202 The name of the remote message port
204 <since_tizen> 4 </since_tizen>
205 <returns> Return name of RemotePort </returns>
207 <member name="P:Tizen.Applications.Messages.RemotePort.Trusted">
209 If true the remote port is a trusted port, otherwise if false it is not
211 <since_tizen> 4 </since_tizen>
212 <returns> Return true if RemotePort is trusted </returns>
214 <member name="M:Tizen.Applications.Messages.RemotePort.IsRunning">
216 Check if the remote message port is running.
218 <since_tizen> 4 </since_tizen>
219 <exception cref="T:System.InvalidOperationException">Thrown when there is an I/O error</exception>
220 <exception cref="T:System.OutOfMemoryException">Thrown when out of memory.</exception>
222 Remote remotePort = new RemotePort("org.tizen.example", "SenderPort", true);
223 bool isRunning = remotePort.isRunning();
225 <returns> Return true if Remote Port is running </returns>
227 <member name="E:Tizen.Applications.Messages.RemotePort.RemotePortStateChanged">
229 Called when the remote port is registered or unregistered.
231 <since_tizen> 4 </since_tizen>
232 <exception cref="T:System.InvalidOperationException">Thrown when there is an I/O error</exception>
233 <exception cref="T:System.OutOfMemoryException">Thrown when out of memory.</exception>
235 Remote remotePort = new RemotePort("org.tizen.example", "SenderPort", true);
236 remotePort.RemotePortStateChanged += RemotePortStateChangedCallback;
237 static void RemotePortStateChangedCallback(object sender, MessageReceivedEventArgs e)
241 case State.Registered :
242 Console.WriteLine("Remote Port Registered ");
244 case State.Unregistered :
245 Console.WriteLine("Remote Port Unregistered ");
253 <member name="M:Tizen.Applications.Messages.RemotePort.Dispose(System.Boolean)">
255 Releases the unmanaged resources used by the RemotePort class specifying whether to perform a normal dispose operation.
257 <param name="disposing">true for a normal dispose operation; false to finalize the handle.</param>
259 <member name="M:Tizen.Applications.Messages.RemotePort.Dispose">
261 Releases all resources used by the RemotePort class.
263 <since_tizen> 4 </since_tizen>
265 <member name="T:Tizen.Applications.Messages.State">
267 Enumeration for Remote Message Port state type
269 <since_tizen> 4 </since_tizen>
271 <member name="F:Tizen.Applications.Messages.State.Unregistered">
273 Value representing Remote Port state is unregistered
276 <member name="F:Tizen.Applications.Messages.State.Registered">
278 Value representing Remote Port state is registered
281 <member name="T:Tizen.Applications.Messages.RemotePortStateChangedEventArgs">
283 An extended EventArgs class which contains state of remote message port
285 <since_tizen> 4 </since_tizen>
287 <member name="P:Tizen.Applications.Messages.RemotePortStateChangedEventArgs.Status">
289 The State of remote port
291 <since_tizen> 4 </since_tizen>
293 <member name="T:Tizen.Applications.Messages.RemoteValues">
295 Contains AppId, port name, and trusted.
298 <member name="P:Tizen.Applications.Messages.RemoteValues.AppId">
300 The ID of the remote application that sent this message.
303 <member name="P:Tizen.Applications.Messages.RemoteValues.PortName">
305 The name of the remote message port.
308 <member name="P:Tizen.Applications.Messages.RemoteValues.Trusted">
310 If true, the remote port is a trusted port, otherwise, if false, it is not.