Beispiel #1
0
        public ReceiveMessageReply ReceiveMessages(ReceiveMessageRequest request)
        {
            List <Message> messages = new List <Message>();

            lock (this)
            {
                messages = serverManagement.GetMessageCorrespondence(request.User, request.Url);
            }
            if (messages.Count > 0)
            {
                Console.WriteLine($"Client {request.User.Name} with Id {request.User.Id} request all messages at {request.Url}");
            }
            else
            {
                Console.WriteLine($"Client {request.User.Name} with Id {request.User.Id} FAILED to request all messages at {request.Url}");
            }
            ReceiveMessageReply reply = new ReceiveMessageReply();

            reply.Messages.AddRange(messages);

            return(reply);
        }