protected void OnWhatTimeIsIt(IClientSocket client, ICommand command) { WhatTimeIsItCommand wtit = (WhatTimeIsItCommand)command; Console.Out.WriteLine(String.Format( "< Server replied back with time is {0} for client {1}", wtit.TheTime, client )); }
public void OnEcho(IClientSocket socket, ICommand command) { EchoCommand reply = (EchoCommand)command; Console.Out.WriteLine("< Client received echo-reply on seq: " + reply.Sequence); WhatTimeIsItCommand wtit = new WhatTimeIsItCommand(); client.Send(wtit); }
protected void OnWhatTimeIsIt(IClientSocket client, ICommand command) { Console.Out.WriteLine(String.Format( "> Server received what time it is request from {0}", client )); String theTime = DateTime.Now.TimeOfDay.ToString(); WhatTimeIsItCommand wtit = (WhatTimeIsItCommand)command; wtit.TheTime = theTime; client.Send(wtit); }