public Person retrievePerson(int agentID) { if (agentObj == null) { if (setupRemote() == false) return null;//well sh*t } RevivePersonAsyncDelegate RemoteDel = new RevivePersonAsyncDelegate(agentObj.getPerson); // Call remote method without callback IAsyncResult RemAr = RemoteDel.BeginInvoke(agentID,null, null); // Wait for the end of the call and then explictly call EndInvoke RemAr.AsyncWaitHandle.WaitOne(); return RemoteDel.EndInvoke(RemAr); }
public Person retrievePerson(int agentID) { if (agentObj == null) { if (setupRemote() == false) { return(null);//well sh*t } } RevivePersonAsyncDelegate RemoteDel = new RevivePersonAsyncDelegate(agentObj.getPerson); // Call remote method without callback IAsyncResult RemAr = RemoteDel.BeginInvoke(agentID, null, null); // Wait for the end of the call and then explictly call EndInvoke RemAr.AsyncWaitHandle.WaitOne(); return(RemoteDel.EndInvoke(RemAr)); }