Run() public méthode

public Run ( ) : Task
Résultat Task
Exemple #1
0
        private void Callback(IAsyncResult ar)
        {
            Socket socket;

            try
            {
                socket = _listener.EndAcceptSocket(ar);
            }
            catch (ObjectDisposedException)
            {
                return;
            }
            _listener.BeginAcceptSocket(Callback, null);
            var instance = new Instance(socket, _app);

            instance.Run()
            .ContinueWith(t =>
            {
                if (!t.IsFaulted)
                {
                    return;
                }
                Trace.TraceError(t.Exception != null ? t.Exception.Message : "A bad thing happened.");
                instance.TryDispose();
            });
        }
Exemple #2
0
 private void Callback(IAsyncResult ar)
 {
     Socket socket;
     try
     {
         socket = _listener.EndAcceptSocket(ar);
     }
     catch (ObjectDisposedException)
     {
         return;
     }
     _listener.BeginAcceptSocket(Callback, null);
     var instance = new Instance(socket, _app);
     instance.Run()
         .ContinueWith(t =>
             {
                 if (!t.IsFaulted) return;
                 Trace.TraceError(t.Exception != null ? t.Exception.Message : "A bad thing happened.");
                 instance.TryDispose();
             });
 }