示例#1
0
 private static Message FinalMessageServe(Server srvr, Sender sndr, Message msg)
 {
     Console.WriteLine("Displaying DB entries");
     srvr.showDB(true, "int");
     Console.Write("\nClient has finished\n");
     Util.swapUrls(ref msg);
     string totalTime = srvr.tot[msg.toUrl].ToString();
     //call the wpf to send message 
     Sender wpfSender = new Sender(Util.makeUrl(srvr.address, srvr.port));
     Message wpfMsg = new Message(); //WPF sender 
     wpfMsg.fromUrl = msg.fromUrl;
     wpfMsg.toUrl = Util.makeUrl(srvr.address, srvr.Wpfport);
     wpfMsg.content = "ServerTime;" + totalTime + ";" + "ClientURL;" + msg.toUrl;
     srvr.tot.Remove(msg.toUrl);
     wpfSender.sendMessage(wpfMsg);
     sndr.sendMessage(msg);       //call the wpf to send message 
     return msg;
 }