Example #1
0
        public void SendMessage(Client client, IOutboundMessage outboundMessage)
        {
            var generatedMessage = _messageProcessor.GenerateMessage(outboundMessage);
            if (outboundMessage.Multiline)
            {
                // Don't send the message yet - store it in the message buffer
                client.MessageBuffer += generatedMessage;
            }
            else
            {
                if (!string.IsNullOrEmpty(client.MessageBuffer))
                {
                    generatedMessage = client.MessageBuffer + generatedMessage;
                    client.MessageBuffer = string.Empty;
                }

                _networkMessager.SendMessage(client.TcpClient, client.CancellationToken, generatedMessage);
            }
        }
Example #2
0
 public AwaitingAuthState(Client client, IMessager messager, IMimeParser mimeParser)
     : base(client, messager, mimeParser)
 {
 }
 public AwaitingRcptCommandState(Client client, IMessager messager, IMimeParser mimeParser)
     : base(client, messager, mimeParser)
 {
 }
Example #4
0
 public void DisconnectClient(Client client)
 {
     _networkMessager.DisconnectClient(client.TcpClient);
 }
Example #5
0
        private void OnClientConnected(object sender, ClientConnectedEventArgs args)
        {
            var client = new Client(args.Client, args.CancellationToken, _messager, _mimeParser);

            _clients.Add(client.ClientIdentifier, client);
        }
Example #6
0
 private void AuthRequired(Client client, string s)
 {
     _messager.SendMessage(client, new OutboundMessageAuthRequired());
 }
 protected AbstractClientState(Client client, IMessager messager, IMimeParser mimeParser)
 {
     _client = client;
     _messager = messager;
     _mimeParser = mimeParser;
 }