Hololens/Lib/UdpSockets.cs
//###########################################################################################
/// <summary>
/// Try to connect a distant host. Awaitable.
/// </summary>
/// <param name="host"> distant host represented by IP adress </param>
/// <param name="port"> port number to reach </param>
/// <returns> true : the connection is done </returns>
Try to connect a distant host. Awaitable.
Try to connect a distant host . Awaitable .
public async Task<bool> Connect(string host, string port)
        {
            if (!_connected)
            {
                SetAddress(host, port);
                try
                {
                    await Connect();
                }
                catch (Exception ex)
                {
                    System.Diagnostics.Debug.WriteLine(ex);
                    return false;
                }
                return true;
            }
            return false;
        }
public async Task < bool > Connect ( string host , string port ) { if ( ! _connected ) { SetAddress ( host , port ) ; try { await Connect ( ) ; } catch ( Exception ex ) { System . Diagnostics . Debug . WriteLine ( ex ) ; return false ; } return true ; } return false ; }
Try to connect a distant host.
Try to connect a distant host .
true : the connection is done
true : the connection is done
host
string
distant host represented by IP adress
distant host represented by IP adress
port
string
port number to reach
port number to reach