Computer A and computer B are running under Windows XP.
Computer C is a domain controller running under Windows 2K
Server.
LAN speed is 100Mb/s.
Time synchronization using : "net time" shell command.
A private queue is created on computer B and associated
with a multicast address.
Computer A sends a 100Kb message to the multicast queue.
Computer B is receiving asynchronously on its local queue.
Sample code :
1-Sender :
private void MulticastSend()
{
MessageQueue myQ = new MessageQueue
("FormatName:MULTICAST=236.1.1.1:8001");
myQ.MessageReadPropertyFilter.SentTime = true;
myQ.MessageReadPropertyFilter.ArrivedTime = true;
System.Messaging.Message myMsg = new
System.Messaging.Message();
myMsg.Body = m_ByteArray;
myQ.Send(myMsg);
return;
}
2-Receiver (asynchronous)
private void Q_ReceiveCompleted(object sender,
System.Messaging.ReceiveCompletedEventArgs e)
{
MessageQueue myQ = (MessageQueue)sender;
myQ.MessageReadPropertyFilter.SentTime = true;
myQ.MessageReadPropertyFilter.ArrivedTime = true;
myQ.Formatter = new XmlMessageFormatter(new Type[]
{typeof(byte[])});
System.Messaging.Message myMsg = myQ.EndReceive
(e.AsyncResult);
myQueue.BeginReceive();
return;
}
Thank you for telling me how to use multicast correctly
(especially in the sender side), and if MSMQ is supposed
to take much more time when using multicast than when not
using (are the SentTime and ArrivedTime message properties
relevant ?).