E-MailRelay
Public Member Functions | List of all members
GNet::Connection Class Referenceabstract

An abstract interface which provides information about a network connection. More...

#include <gconnection.h>

+ Inheritance diagram for GNet::Connection:

Public Member Functions

virtual ~Connection ()=default
 Destructor.
 
virtual Address localAddress () const =0
 Returns the connection's local address. More...
 
virtual Address peerAddress () const =0
 Returns the connection's peer address. More...
 
virtual std::string connectionState () const =0
 Returns the connection state as a display string. More...
 
virtual std::string peerCertificate () const =0
 Returns the peer's TLS certificate. More...
 

Detailed Description

An abstract interface which provides information about a network connection.

See also
GNet::Client, GNet::ServerPeer

Definition at line 37 of file gconnection.h.

Member Function Documentation

◆ connectionState()

virtual std::string GNet::Connection::connectionState ( ) const
pure virtual

Returns the connection state as a display string.

This should be the peerAddress() display string, unless a client connection that has not yet connected.

Implemented in GNet::Client, and GNet::ServerPeer.

◆ localAddress()

virtual Address GNet::Connection::localAddress ( ) const
pure virtual

Returns the connection's local address.

Implemented in GNet::Client, and GNet::ServerPeer.

◆ peerAddress()

virtual Address GNet::Connection::peerAddress ( ) const
pure virtual

Returns the connection's peer address.

Throws if a client connection that has not yet connected.

Implemented in GNet::Client, and GNet::ServerPeer.

◆ peerCertificate()

virtual std::string GNet::Connection::peerCertificate ( ) const
pure virtual

Returns the peer's TLS certificate.

Returns the empty string if none.

Implemented in GNet::Client, and GNet::ServerPeer.


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