F
felecha
I'm stumped. I'm working on an application in VB.Net that uses
System.Messaging.MessageQueue to listen for messages sent to a
private queue on a remote machine. Both machines are in the same
Workgroup in a small private LAN. The messaging is working fine, but
since the remote machine is used as a control system and has to be
rebooted when there is a configuration change, I have to handle the
remote queue going down and coming back up again. My application is
on the "local" machine, listening for messages and processing them
for a user interface.
I just can't figure out how to do that. I'm learning about
MessageQueue from the .Net Help and MSDN documentation and stuff I
can find on the internet. It looks like if I just keep the same
local MessageQueue object listening, it doesn't connect to the new
remote queue. I have to make a new MessageQueue on the local
machine, with a new handle.
If I kill the Message Queuing service on the remote machine, I can
detect that - it throws exceptions in the EndReceive method in my
ReceiveCompleted handler. But the real behavior is going to be
restarting the remote system, and when I try to mimic that on my
development machines, nothing happens in my local application. I've
tried using tests based on MessageQueue.Exists() but it seems that
the method doesn't work for remote machines in a Workgroup setting.
I thought maybe the CanRead() method would tell me if the remote
queue was "alive". I did a repeating timed loop that kept calling
CanRead(), but it kept returning TRUE all the way through the remote
machine's restart.
Any clues? There must be some documentation somewhere. People must
have to deal with this in their applications.
System.Messaging.MessageQueue to listen for messages sent to a
private queue on a remote machine. Both machines are in the same
Workgroup in a small private LAN. The messaging is working fine, but
since the remote machine is used as a control system and has to be
rebooted when there is a configuration change, I have to handle the
remote queue going down and coming back up again. My application is
on the "local" machine, listening for messages and processing them
for a user interface.
I just can't figure out how to do that. I'm learning about
MessageQueue from the .Net Help and MSDN documentation and stuff I
can find on the internet. It looks like if I just keep the same
local MessageQueue object listening, it doesn't connect to the new
remote queue. I have to make a new MessageQueue on the local
machine, with a new handle.
If I kill the Message Queuing service on the remote machine, I can
detect that - it throws exceptions in the EndReceive method in my
ReceiveCompleted handler. But the real behavior is going to be
restarting the remote system, and when I try to mimic that on my
development machines, nothing happens in my local application. I've
tried using tests based on MessageQueue.Exists() but it seems that
the method doesn't work for remote machines in a Workgroup setting.
I thought maybe the CanRead() method would tell me if the remote
queue was "alive". I did a repeating timed loop that kept calling
CanRead(), but it kept returning TRUE all the way through the remote
machine's restart.
Any clues? There must be some documentation somewhere. People must
have to deal with this in their applications.