E-MailRelay

Public Member Functions | List of all members
GNet::SocketProtocolSink Class Referenceabstract

An interface used by GNet::SocketProtocol to deliver data from a socket. More...

`#include <gsocketprotocol.h>`

Inheritance diagram for GNet::SocketProtocolSink:
[legend]

## Public Member Functions
virtual | ~SocketProtocolSink ()=default
| Destructor.
virtual void | onData (const char *, std::size_t)=0
| Called when data is read from the socket. More...
virtual void | onSecure (const std::string &peer_certificate, const std::string &protocol, const std::string &cipher)=0
| Called once the secure socket protocol has been successfully negotiated.
virtual void | onPeerDisconnect ()=0
| Called, if enabled by the readEvent()/otherEvent() parameter, when the peer disconnects with a socket shutdown. More...

## Detailed Description

An interface used by GNet::SocketProtocol to deliver data from a socket.

Definition at line 176 of file gsocketprotocol.h.

## Member Function Documentation

## ◆ onData()

virtual void GNet::SocketProtocolSink::onData | ( | const char * | ,
|  | std::size_t |
| ) |  |
| pure virtual

Called when data is read from the socket.

Implemented in GNet::ServerPeer.

## ◆ onPeerDisconnect()

virtual void GNet::SocketProtocolSink::onPeerDisconnect | ( |  | ) |
| pure virtual

Called, if enabled by the readEvent()/otherEvent() parameter, when the peer disconnects with a socket shutdown.

This tells us that the peer will not send any more data but we can keep sending. The SocketProtocol class will have already dropped the socket read handler. If we have previously done our own shutdown then both directions are now closed and the connection is defunct.

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

- /tmp/slackdce/slackrepo.HKsbdz/build_emailrelay/emailrelay-2.6/src/gnet/gsocketprotocol.h