Example #1
0
        public static void SendEchoRequest(TestClientSocket client, string message)
        {
            CsEchoRequest proto = new CsEchoRequest();

            proto.Message = message;

            Packet packet = new Packet();

            packet.EncodePacket(TcpServerCommand.CsEchoRequest, proto);
            client.Send(packet);
        }
Example #2
0
        protected static bool OnEchoRequest(UserSocket client, CodedInputStream stream)
        {
            CsEchoRequest proto   = CsEchoRequest.Parser.ParseFrom(stream);
            string        message = proto.Message;

            Console.WriteLine(message);

            CsEchoOk response = new CsEchoOk();

            response.Message = message;

            Packet packet = new Packet();

            packet.EncodePacket(TcpServerCommand.CsEchoOk, response);
            client.Send(packet);

            return(true);
        }