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, 而之后刚好该回调被调用 } }
private void _onRecv(IAsyncResult ar) { AsyncReceiveMethod caller = (AsyncReceiveMethod)ar.AsyncState;; caller.EndInvoke(ar); }