Run() public method

public Run ( ) : Task
return Task
示例#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();
            });
        }
示例#2
0
文件: Server.cs 项目: markrendle/Flux
 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();
             });
 }