E-MailRelay

Public Member Functions | List of all members
GSmtp::ServerSender Class Referenceabstract

An interface used by ServerProtocol to send protocol responses. More...

`#include <gsmtpserversender.h>`

Inheritance diagram for GSmtp::ServerSender:
[legend]

## Public Member Functions
virtual void | protocolSend (const std::string &s, bool flush)=0
| Called when the server protocol class wants to send data down the socket. More...
virtual void | protocolSecure ()=0
| Called when the protocol class wants a secure connection to be initiated. More...
virtual void | protocolShutdown (int how)=0
| Called on receipt of a quit command after the quit response has been sent. More...
virtual void | protocolExpect (std::size_t n)=0
| Requests that the next call to ServerProtocol::apply() carries exactly 'n' bytes of binary data rather than a line of text. More...
virtual | ~ServerSender ()=default
| Destructor.

## Detailed Description

An interface used by ServerProtocol to send protocol responses.

The RFC-2920 PIPELINING extension defines how SMTP input requests and output responses should be batched up. At this interface that means that protocolSend() has a 'flush' parameter to mark the end of an output batch.

Definition at line 40 of file gsmtpserversender.h.

## Member Function Documentation

## ◆ protocolExpect()

virtual void GSmtp::ServerSender::protocolExpect | ( | std::size_t | n | ) |
| pure virtual

Requests that the next call to ServerProtocol::apply() carries exactly 'n' bytes of binary data rather than a line of text.

This only called if the protocol config item 'with_chunking' is true.

## ◆ protocolSecure()

virtual void GSmtp::ServerSender::protocolSecure | ( |  | ) |
| pure virtual

Called when the protocol class wants a secure connection to be initiated.

ServerProtocol::secure() should be called when complete.

## ◆ protocolSend()

virtual void GSmtp::ServerSender::protocolSend | ( | const std::string & | s,
|  | bool | flush
| ) |  |
| pure virtual

Called when the server protocol class wants to send data down the socket.

The data should be batched up if 'flush' is false. The 'flush' parameter will always be true if the server protocol is not using pipelining.

If the server protocol is using pipelining then calls to protocolSend() might come in quick succession, so the implementation must queue up the output if the socket applies flow control. There is no need to tell the protocol when flow control is released.

## ◆ protocolShutdown()

virtual void GSmtp::ServerSender::protocolShutdown | ( | int | how | ) |
| pure virtual

Called on receipt of a quit command after the quit response has been sent.

The implementation should normally do a socket shutdown if the parameter is 0, 1 or 2. See also Socket::shutdown().

The documentation for this class was generated from the following file:

- /tmp/slackdce/slackrepo.HKsbdz/build_emailrelay/emailrelay-2.6/src/gsmtp/gsmtpserversender.h