SEDNL  .
Simple Event Driven Network Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SedNL::SocketInterface Class Referenceabstract

Describe functions that Connection, TCPClient and TCPServer should have (like a connected / unconnected state). More...

#include <SocketInterface.hpp>

Inheritance diagram for SedNL::SocketInterface:
SedNL::NonCopyable SedNL::Connection SedNL::TCPServer SedNL::TCPClient

Public Member Functions

 SocketInterface () noexcept
 Initialise member data.
 
virtual void disconnect () noexcept=0
 Should be implemented by client/server/connection.
 
bool is_connected () const noexcept
 Tell if the client/server/connection is connected. More...
 
 operator bool () const noexcept
 Call is_connected().
 

Protected Member Functions

FileDescriptor get_fd () noexcept
 

Protected Attributes

bool m_connected
 Connection state.
 
FileDescriptor m_fd
 Socket file descriptor.
 
std::mutex m_mutex
 Mutex used for synchronisation while sending events, closing the connection, or changing the user data.
 

Detailed Description

Describe functions that Connection, TCPClient and TCPServer should have (like a connected / unconnected state).

For use cases, see TCPClient, TCPServer and Connecton objects.

Definition at line 39 of file SocketInterface.hpp.

Member Function Documentation

bool SedNL::SocketInterface::is_connected ( ) const
inlinenoexcept

Tell if the client/server/connection is connected.

Returns
True if connected, false otherwise.

Definition at line 36 of file SocketInterface.ipp.


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