public void Invoke() { try { client.BeginSendAndReceive( client.DoOutput(functionName, arguments, byRef, simple, context), new AsyncCallback(SendAndReceiveCallback)); } catch (Exception e) { DoError(e); } }
internal void GetOutputStream(IAsyncResult asyncResult) { Stream ostream = null; bool success = false; try { ostream = client.EndGetOutputStream(asyncResult); client.DoOutput(functionName, arguments, byRef, ostream); success = true; } catch (Exception e) { result = e; syncContext.Post(new SendOrPostCallback(DoCallback), null); return; } finally { if (ostream != null) { client.SendData(ostream, asyncResult.AsyncState, success); } } client.BeginGetInputStream(new AsyncCallback(GetInputStream), asyncResult.AsyncState); }