コード例 #1
0
        void IMailTransceiver.Post(EMLetter letter)
        {
            CheckLogin();

            letter.SetEnvelope(GetEnvelope());

            this.AsyncRequest(StatusCode.Letter, letter, letter.GetTTL(this.Now));
        }
コード例 #2
0
        EMLetter IMailTransceiver.Get(EMLetter letter)
        {
            letter.SetEnvelope(GetEnvelope());

            var reply = Request(StatusCode.Letter, letter, letter.GetTTL(server.Now));

            return(reply as EMLetter);
        }
コード例 #3
0
        EMLetter IMailTransceiver.Get(EMLetter letter)  // dispatch the local letter to server
        {
            CheckLogin();

            letter.SetEnvelope(GetEnvelope());

            var reply = Request(StatusCode.Letter, letter, letter.GetTTL(this.Now));

            if (reply.HasFlag(StatusCode.Denied))
            {
                throw new EOCException((reply as EMText).Text);
            }

            return(reply as EMLetter);
        }
コード例 #4
0
        private EMLetter Pickup(EMLetter letter)
        {
            LetterContent feedback;

            try
            {
                feedback = receiver.Pickup(letter);
            }
            catch (Exception ex)  // exception report
            {
                feedback = new LetterContent("error", ex.Message, TransmissionMode.Post);
            }

            if (feedback == null)
            {
                return(null);
            }

            var fbLetter = new EMLetter(letter.Sender, this.MailAdress, feedback, letter.GetTTL(this.Now));

            fbLetter.SetEnvelope(new Envelope(letter.ID));

            return(fbLetter);
        }
コード例 #5
0
        void IMailTransceiver.Post(EMLetter letter)
        {
            letter.SetEnvelope(GetEnvelope());

            this.AsyncRequest(StatusCode.Letter, letter, letter.GetTTL(server.Now));
        }