/* * 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()); } }
public void GetResult() { awaiter.GetResult(); }
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); }