private void _onRecv(IAsyncResult ar) { AsyncResult result = (AsyncResult)ar; AsyncReceiveMethod caller = (AsyncReceiveMethod)result.AsyncDelegate; caller.EndInvoke(ar); }
private void _onRecv(IAsyncResult ar) { try { AsyncReceiveMethod caller = (AsyncReceiveMethod)ar.AsyncState; caller.EndInvoke(ar); } catch (ObjectDisposedException) { //通常出现这个错误, 是因为longin_baseapp时, networkInterface已经reset, _packetReceiver被置为null, 而之后刚好该回调被调用 } }
public void startRecv() { var v = new AsyncReceiveMethod(this._asyncReceive); v.BeginInvoke(new AsyncCallback(_onRecv), null); }
public virtual void startRecv() { AsyncReceiveMethod asyncReceiveMethod = new AsyncReceiveMethod(this._asyncReceive); asyncReceiveMethod.BeginInvoke(new AsyncCallback(_onRecv), asyncReceiveMethod); }
private void _onRecv(IAsyncResult ar) { AsyncReceiveMethod caller = (AsyncReceiveMethod)ar.AsyncState;; caller.EndInvoke(ar); }
public void startRecv() { var v = new AsyncReceiveMethod(this._asyncReceive); v.BeginInvoke(new AsyncCallback(_onRecv), null); }