예제 #1
0
        public async Task ListenAllConnectedAsync()
        {
            var hostnames = await HostNameProvider.GetConnectedHostsAsync();

            if (hostnames.Count == 0)
            {
                if (NetworkNotAvailable != null)
                {
                    NetworkNotAvailable(this, null);
                }
                return;
            }

            foreach (var host in hostnames)
            {
                await server.BindPortAsync(host, SHUB_PORT);
            }
            await server.BindPortAsync(HostNameProvider.GetLoopbackHost(), SHUB_PORT);
        }
예제 #2
0
 public async Task ConnectViaLoopbackAsync()
 {
     await ConnectAsync(HostNameProvider.GetLoopbackHost().CanonicalName);
 }
예제 #3
0
 public async Task ListenViaLoopbackAsync()
 {
     await server.BindPortAsync(HostNameProvider.GetLoopbackHost(), SHUB_PORT);
 }