コード例 #1
0
        /// <summary>
        /// Opens the specified port for listening to any incoming connections.
        /// </summary>
        /// <returns></returns>
        public async Task StartListeningAsync()
        {
            try
            {
                Listener.ConnectionReceived += Listener_ConnectionReceived;
                Listener.ConnectionReceived += ConnectionReceived;

                await Listener.BindServiceNameAsync(Port.ToString());
            }
            catch (Exception ex)
            {
                ErrorStatus = SocketError.GetStatus(ex.HResult);
                throw;
            }
        }