예제 #1
0
    /*
     * Default Required To Initialize the MainAsync() method.
     */
    public static void Main(string[] args)
    {
        Program p = new Program();

        int length = (int)CacheReader.Open();

        cache = CacheReader.SeekCache(0, length, length + 8192);
        CacheReader.Close();

        Task task = p.MainAsync();

        System.Runtime.CompilerServices.TaskAwaiter await = task.GetAwaiter();
        try
        {
            await.GetResult();
        } catch (Exception e)
        {
            Console.WriteLine(e.ToString());
        }
    }
예제 #2
0
파일: AsyncManager.cs 프로젝트: kzu/Merq
 public void GetResult()
 {
     awaiter.GetResult();
 }
예제 #3
0
 private void ProcessAuthenticationResponse(TaskAwaiter<bool?> authenticationAwaiter, GossipConnection gossipConnection)
 {
     bool? result;
     try
     {
         result = authenticationAwaiter.GetResult();
     }
     catch (IOException)
     {
         return;
     }
     if (!result.HasValue) return;
     if (!result.Value)
     {
         OnClientConnectionAuthenticationFailed(this, gossipConnection);
         return;
     }
     ClientConnectionAuthenticationSucceeded(gossipConnection);
     OnClientConnectionAuthenticationSucceeded(this, gossipConnection);
 }