Woman, Life, Freedom


Async BSD Sockets Library
Library protected and public interface header documentation
AsyncBsdSocketLib::Communicator Class Referenceabstract

Communication method (i.e., network sockets and named pipes) More...

#include <communicator.h>

Inheritance diagram for AsyncBsdSocketLib::Communicator:
AsyncBsdSocketLib::FifoReceiver AsyncBsdSocketLib::FifoSender AsyncBsdSocketLib::NetworkSocket AsyncBsdSocketLib::TcpClient AsyncBsdSocketLib::TcpListener AsyncBsdSocketLib::UdpClient

Public Member Functions

int Descriptor () const noexcept
 File descriptor. More...
 
virtual int Connection () const noexcept=0
 Connection descriptor for sending and receiving. More...
 
virtual bool TrySetup () noexcept=0
 Try to setup the communicator. More...
 
virtual bool TryClose () noexcept
 Try to close the communicator. More...
 

Protected Attributes

int FileDescriptor
 File descriptor.
 

Detailed Description

Communication method (i.e., network sockets and named pipes)

Member Function Documentation

◆ Connection()

virtual int AsyncBsdSocketLib::Communicator::Connection ( ) const
pure virtualnoexcept

Connection descriptor for sending and receiving.

Returns
A non-negative value if there is a valid connection; otherwise -1

Implemented in AsyncBsdSocketLib::FifoReceiver, AsyncBsdSocketLib::FifoSender, AsyncBsdSocketLib::TcpClient, AsyncBsdSocketLib::TcpListener, and AsyncBsdSocketLib::UdpClient.

◆ Descriptor()

int AsyncBsdSocketLib::Communicator::Descriptor ( ) const
noexcept

File descriptor.

Returns
A non-negative number if the communicator has been already set up

◆ TryClose()

virtual bool AsyncBsdSocketLib::Communicator::TryClose ( )
virtualnoexcept

Try to close the communicator.

Returns
True if the communicator closed successfully; otherwise false

◆ TrySetup()

virtual bool AsyncBsdSocketLib::Communicator::TrySetup ( )
pure virtualnoexcept

Try to setup the communicator.

Returns
True if the communicator is successfully set up; otherwise false

Implemented in AsyncBsdSocketLib::FifoReceiver, AsyncBsdSocketLib::FifoSender, AsyncBsdSocketLib::TcpClient, AsyncBsdSocketLib::TcpListener, and AsyncBsdSocketLib::UdpClient.