コード例 #1
0
        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
                                      ));
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }