/// <inheritdoc />
        public void Connect()
        {
            if (net == null)
            {
                Debug.LogError("TCPConnectionManager not set for SocketNetworkingService. Unable to establish connection");
                return;
            }
            else
            {
                net.DisconnectAll();
            }

            net.OnConnected    += OnConnected;
            net.OnDisconnected += OnDisconnected;
            net.OnReceive      += OnReceive;

            if (runAsUser)
            {
                net.StartListening(userPort);
            }
            else
            {
                net.ConnectTo(userAddress, userPort);
            }
        }
 /// <inheritdoc />
 public void ConnectTo(string ipAddress, int port)
 {
     if (connectionManager != null)
     {
         connectionManager.ConnectTo(ipAddress, port);
     }
     else
     {
         Debug.LogError($"Failed to start connecting: {nameof(connectionManager)} was not assigned.");
     }
 }
Exemple #3
0
        private void Start()
        {
            connectionManager.OnConnected    += OnNetConnected;
            connectionManager.OnDisconnected += OnNetDisconnected;
            connectionManager.OnReceive      += OnNetReceived;

            if (runAsServer)
            {
                connectionManager.StartListening(serverPort);
            }
            else
            {
                connectionManager.ConnectTo(serverAddress, serverPort);
            }
        }
Exemple #4
0
 /// <summary>
 /// Connects to the holographic camera rig with the provided remote IP address.
 /// </summary>
 /// <param name="remoteAddress">The IP address of the holographic camera rig's HoloLens.</param>
 public void ConnectTo(string remoteAddress)
 {
     connectionManager.ConnectTo(remoteAddress, RemotePort);
 }