10.07.2015 Views

pdf - 395 K - Ecole des mines de Nantes

pdf - 395 K - Ecole des mines de Nantes

pdf - 395 K - Ecole des mines de Nantes

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

address.Process);remote (.Net bug orget all the privatethe right one. Not thequeues)queue);}catch{// Cannot get remote queuesreturn null;}string path = MakePath(address.Computer,// Obtaining queue directly fails if it is// insufficient documentation?) so instead we// queues on the remote machine and select// most efficient way, but it works.foreach (System.Messaging.MessageQueue q in{if (q.Path.EndsWith(path)){queue = q;break;}}if (queue != null) queueTable.Add(address,} // End queue already known} // End lockreturn queue;/// /// Transmits a Message to the (possibly remote) recipientIAgent./// /// public void PostMessage(Message m){Debug.Assert(m != null);AgentId recipientId = m.Recipient;AgentAddress address =NameServer.GetNS().FindAddressOf(recipientId);Debug.Assert(address != null);if (Middleware.IsThisHost(address)){// The specified computer name in the agent ID isthis computer// so the agent should be localIAgent recipient = FindAgent(recipientId);if (recipient != null)recipient.PostMessage(m);elseConsole.WriteLine("MT could not findrecipient "+ " for {0} in host {1}", m,Middleware.ThisAddress);}else{// Forward the Message to a remoteMessageTransporter via MSMQMSc EMOOSE Thesis – http://www.emn.fr/EMOOSE 70

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!