I have 2 modules communicating via a proxy.
The first module, labeled "CL" so I assume that's the client, creates a proxy with a
Activator.GetObjectcall
.
That seems to work as the output is not null.
Then a delegate for this proxy is created and called using
BeginInvoke<code>.<br />
<br />
We wait using <code>WaitOne
, then retrieve the result using
EndInvoke
.
The delegate function returns with an error, but because I can't debug beyond the
BeginInvoke call
, I don't know why.
I tried putting a break point in the other module, labeled "SV" so I assume that's the server, but doesn't stop.
Same for the proxy.
So it goes something like
...
m_proxy = (MyProxy)Activator.GetObject(typeof(MyProxy), stringProxyAddress);
...
MyDelegate dlgt = null;
IAsyncResult iAsyncResult = null;
bool bAsyncResult = false;
int retCode = 0;
dlgt = new MyDelegate(m_proxy.Foo);
iAsyncResult = dlgt.BeginInvoke(input1, input2, null, null);
...
bAsyncResult = iAsyncResult.AsyncWaitHandle.WaitOne(timeout, false);
...
if(bAsyncResult)
{
retCode = dlgt.EndInvoke(iAsyncResult);
}
...
retCode
comes back with an error value, but I can't trace the cause of the error because I can't debug inside
Foo
.
How shall I go about debugging this?
Any advice greatly appreciated!
======================
OK, I've done more reading and debugging and have a few more questions.
1) Doesn't the
Activator.GetObject
call need a pairing
RegisterChannel
to complete the communication?
2) I tried to attach the server project to the server process but the server process won't turn up in the list of processes to attach to from Visual Studio even with the "show all processes" turned ON. That's despite being able to see the required process in Task Manager.
3) And I've come back full circle and am still left wondering how to debug the proxy...
Any ideas? Please?