public void Start() { clientsList = new BindingList <Socket>(); clientsList.RaiseListChangedEvents = true; AsyncOperationDelegate asyncDel = new AsyncOperationDelegate(StartServer); asyncDel.BeginInvoke(new AsyncCallback(EndServer), asyncDel); }
private void EndServer(IAsyncResult result) { lock (synclock) { clientsList.Clear(); } AsyncOperationDelegate asyncDel = result.AsyncState as AsyncOperationDelegate; asyncDel.EndInvoke(result); }
public bool TryGetDelegate( [MaybeNullWhen(false)] out AsyncOperationDelegate asyncDelegate) { if (!this.IsImplemented) { asyncDelegate = null !; return(false); } asyncDelegate = this.Delegate !; return(true); }
private void EndConnect(IAsyncResult result) { AsyncOperationDelegate asyncDel = result.AsyncState as AsyncOperationDelegate; asyncDel.EndInvoke(result); stopped = true; if (OnStopped != null) { OnStopped(this); } }
void Start() { var op1 = new AsyncOperationDelegate(CounterDelegate); var op2 = new AsyncOperationDelegate(CounterDelegate); var op3 = new AsyncOperationDelegate(CounterDelegate); op1.Success += (sender, e) => { Debug.Log("finish op1"); }; op2.Success += (sender, e) => { Debug.Log("finish op2"); }; op3.Success += (sender, e) => { Debug.Log("finish op3"); }; op1.Execute(); op2.Execute(); op3.Execute(); }
public void Start() { AsyncOperationDelegate asyncDel = new AsyncOperationDelegate(ConnectToServer); asyncDel.BeginInvoke(new AsyncCallback(EndConnect), asyncDel); }