AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
NetworkConnectionAdapter.cs
Go to the documentation of this file.
1 // Copyright (c) Microsoft Corporation. All rights reserved.
2 // Licensed under the MIT License. See LICENSE in the project root for license information.
3 
4 namespace HoloToolkit.Sharing
5 {
11  {
16 
18 
19  public override void OnConnected(NetworkConnection connection)
20  {
21  Profile.BeginRange("OnConnected");
22  if (this.ConnectedCallback != null)
23  {
24  this.ConnectedCallback(connection);
25  }
26  Profile.EndRange();
27  }
28 
29  public override void OnConnectFailed(NetworkConnection connection)
30  {
31  Profile.BeginRange("OnConnectFailed");
32  if (this.ConnectionFailedCallback != null)
33  {
34  this.ConnectionFailedCallback(connection);
35  }
36  Profile.EndRange();
37  }
38 
39  public override void OnDisconnected(NetworkConnection connection)
40  {
41  Profile.BeginRange("OnDisconnected");
42  if (this.DisconnectedCallback != null)
43  {
44  this.DisconnectedCallback(connection);
45  }
46  Profile.EndRange();
47  }
48 
49  public override void OnMessageReceived(NetworkConnection connection, NetworkInMessage message)
50  {
51  Profile.BeginRange("OnMessageReceived");
52  if (this.MessageReceivedCallback != null)
53  {
54  this.MessageReceivedCallback(connection, message);
55  }
56  Profile.EndRange();
57  }
58  }
59 }
System.Action< NetworkConnection > ConnectedCallback
override void OnMessageReceived(NetworkConnection connection, NetworkInMessage message)
System.Action< NetworkConnection > ConnectionFailedCallback
override void OnDisconnected(NetworkConnection connection)
override void OnConnectFailed(NetworkConnection connection)
Allows users of NetworkConnection to register to receive event callbacks without having their classes...
static void EndRange()
Definition: Profile.cs:48
override void OnConnected(NetworkConnection connection)
System.Action< NetworkConnection, NetworkInMessage > MessageReceivedCallback
System.Action< NetworkConnection > DisconnectedCallback
static void BeginRange(string name)
Definition: Profile.cs:43