private void SendAndReceiveCallback(IAsyncResult asyncResult) { try { object result = client.DoInput(client.EndSendAndReceive(asyncResult), arguments, returnType, resultMode, context); if (result is HproseException) { DoError(result); } else { syncContext.Post(new SendOrPostCallback(DoCallback), result); } } catch (Exception e) { DoError(e); } }
internal void GetInputStream(IAsyncResult asyncResult) { bool success = false; result = null; Stream istream = null; try { istream = client.EndGetInputStream(asyncResult); result = client.DoInput(arguments, returnType, resultMode, istream); success = true; } catch (Exception e) { result = e; } finally { if (istream != null) { client.EndInvoke(istream, asyncResult.AsyncState, success); } } syncContext.Post(new SendOrPostCallback(DoCallback), null); }