11// Copyright (c) Microsoft Corporation. All rights reserved.
22// Licensed under the MIT License. See LICENSE in the project root for license information.
33
4+ using System ;
45using UnityEngine ;
56using HoloToolkit . Unity ;
67
@@ -20,7 +21,6 @@ namespace HoloToolkit.Examples.SharingWithUNET
2021 /// </summary>
2122 public class GenericNetworkTransmitter : Singleton < GenericNetworkTransmitter >
2223 {
23-
2424 [ Tooltip ( "The connection port on the machine to use." ) ]
2525 public int SendConnectionPort = 11000 ;
2626
@@ -29,12 +29,12 @@ public class GenericNetworkTransmitter : Singleton<GenericNetworkTransmitter>
2929 /// </summary>
3030 /// <param name="data">The data that arrived.</param>
3131 public delegate void OnDataReady ( byte [ ] data ) ;
32- public event OnDataReady dataReadyEvent ;
32+ public event OnDataReady DataReadyEvent ;
3333
3434 /// <summary>
3535 /// The server to connect to when data is needed.
3636 /// </summary>
37- private string serverIP ;
37+ private string serverIp = string . Empty ;
3838
3939 /// <summary>
4040 /// Tracks if we have a connection request outstanding.
@@ -58,10 +58,10 @@ public void SetData(byte[] data)
5858 /// <summary>
5959 /// Tells us who to contact if we need data.
6060 /// </summary>
61- /// <param name="ServerIP "></param>
62- public void SetServerIP ( string ServerIP )
61+ /// <param name="_serverIp "></param>
62+ public void SetServerIp ( string _serverIp )
6363 {
64- serverIP = ServerIP . Trim ( ) ;
64+ serverIp = _serverIp . Trim ( ) ;
6565 }
6666
6767 /// <summary>
@@ -193,12 +193,6 @@ private async void RcvNetworkConnectedHandler(IAsyncAction asyncInfo, AsyncStatu
193193 else
194194 {
195195 Debug . Log ( "Failed to establish connection for rcv. Error Code: " + asyncInfo . ErrorCode ) ;
196- // In the failure case we'll requeue the data and wait before trying again.
197-
198-
199- // And set the defer time so the update loop can do the 'Unity things'
200- // on the main Unity thread.
201- Invoke ( "RequestAndGetAnchor" , timeToDeferFailedConnections ) ;
202196 }
203197
204198 networkConnection . Dispose ( ) ;
@@ -210,7 +204,7 @@ public void ConfigureAsServer()
210204 {
211205 Debug . Log ( "This script is not intended to be run from the Unity Editor" ) ;
212206 // In order to avoid compiler warnings in the Unity Editor we have to access a few of our fields.
213- Debug . Log ( string . Format ( "serverIP = {0} waitingForConnection = {1} mostRecentDataBuffer = {2}" , serverIP , waitingForConnection , mostRecentDataBuffer == null ? "No there" : "there" ) ) ;
207+ Debug . Log ( string . Format ( "serverIP = {0} waitingForConnection = {1} mostRecentDataBuffer = {2}" , serverIp , waitingForConnection , mostRecentDataBuffer == null ? "No there" : "there" ) ) ;
214208 }
215209 private void ConnectListener ( ) { }
216210#endif
0 commit comments