W
wobbles
Hi Everyone,
I've spent hours investigating why my Async (one way) call wasn't
invoking the method on my server.
Basically, if I remove " Console.ReadLine() ", the method DOESN'T get
invoked.
Can anyone tell me why? Does the call require a pause?
(ErrorInformation is a serializable struct - for those who are
wondering)
Here's my code:
=========
private void Write(ErrorInformation ei) {
HttpChannel channel = new HttpChannel();
ChannelServices.RegisterChannel(channel);
IRemoteObject obj = (IRemoteObject) Activator.GetObject(
typeof(IRemoteObject),
"http://localhost:50000/ServerExceptionLog.soap");
RemoteWriteDelegate rwrDelegate = new RemoteWriteDelegate(obj.Write);
IAsyncResult rwrAsyncres = rwrDelegate.BeginInvoke(ei, null, null);
try {
rwrDelegate.EndInvoke(rwrAsyncres);
}catch(Exception e) {
//do something
}
// wait for keypress
Console.ReadLine();
}
=========
I've spent hours investigating why my Async (one way) call wasn't
invoking the method on my server.
Basically, if I remove " Console.ReadLine() ", the method DOESN'T get
invoked.
Can anyone tell me why? Does the call require a pause?
(ErrorInformation is a serializable struct - for those who are
wondering)
Here's my code:
=========
private void Write(ErrorInformation ei) {
HttpChannel channel = new HttpChannel();
ChannelServices.RegisterChannel(channel);
IRemoteObject obj = (IRemoteObject) Activator.GetObject(
typeof(IRemoteObject),
"http://localhost:50000/ServerExceptionLog.soap");
RemoteWriteDelegate rwrDelegate = new RemoteWriteDelegate(obj.Write);
IAsyncResult rwrAsyncres = rwrDelegate.BeginInvoke(ei, null, null);
try {
rwrDelegate.EndInvoke(rwrAsyncres);
}catch(Exception e) {
//do something
}
// wait for keypress
Console.ReadLine();
}
=========