Mema
Memory Matrix — multi-channel audio matrix monitor and router
Loading...
Searching...
No Matches
Mema::InterprocessConnectionServerImpl Class Reference

TCP server that accepts multiple simultaneous client connections on a fixed port. More...

#include <InterprocessConnection.h>

+ Inheritance diagram for Mema::InterprocessConnectionServerImpl:
+ Collaboration diagram for Mema::InterprocessConnectionServerImpl:

Public Member Functions

 InterprocessConnectionServerImpl ()
 
virtual ~InterprocessConnectionServerImpl ()
 
void createMessageThread (int id)
 
std::map< int, std::pair< double, bool > > getListHealth ()
 
bool hasActiveConnection (int id)
 
bool hasActiveConnections ()
 
const std::unique_ptr< InterprocessConnectionImpl > & getActiveConnection (int id)
 
const std::vector< int > cleanupDeadConnections ()
 
const std::vector< int > getActiveConnectionIds ()
 
bool enqueueMessage (const MemoryBlock &message, std::vector< int > sendIds={})
 

Public Attributes

std::function< void(int)> onConnectionCreated
 

Static Public Attributes

static constexpr double s_listSizeThreshold = 35.0
 

Detailed Description

TCP server that accepts multiple simultaneous client connections on a fixed port.

Definition at line 57 of file InterprocessConnection.h.

Constructor & Destructor Documentation

◆ InterprocessConnectionServerImpl()

Mema::InterprocessConnectionServerImpl::InterprocessConnectionServerImpl ( )

Definition at line 62 of file InterprocessConnection.cpp.

◆ ~InterprocessConnectionServerImpl()

Mema::InterprocessConnectionServerImpl::~InterprocessConnectionServerImpl ( )
virtual

Definition at line 67 of file InterprocessConnection.cpp.

Member Function Documentation

◆ cleanupDeadConnections()

const std::vector< int > Mema::InterprocessConnectionServerImpl::cleanupDeadConnections ( )

Definition at line 173 of file InterprocessConnection.cpp.

◆ createMessageThread()

void Mema::InterprocessConnectionServerImpl::createMessageThread ( int  id)

Definition at line 75 of file InterprocessConnection.cpp.

◆ enqueueMessage()

bool Mema::InterprocessConnectionServerImpl::enqueueMessage ( const MemoryBlock &  message,
std::vector< int >  sendIds = {} 
)

Definition at line 197 of file InterprocessConnection.cpp.

References s_listSizeThreshold.

◆ getActiveConnection()

const std::unique_ptr< InterprocessConnectionImpl > & Mema::InterprocessConnectionServerImpl::getActiveConnection ( int  id)

Definition at line 168 of file InterprocessConnection.cpp.

◆ getActiveConnectionIds()

const std::vector< int > Mema::InterprocessConnectionServerImpl::getActiveConnectionIds ( )

Definition at line 189 of file InterprocessConnection.cpp.

◆ getListHealth()

std::map< int, std::pair< double, bool > > Mema::InterprocessConnectionServerImpl::getListHealth ( )

Definition at line 124 of file InterprocessConnection.cpp.

References s_listSizeThreshold.

◆ hasActiveConnection()

bool Mema::InterprocessConnectionServerImpl::hasActiveConnection ( int  id)

Definition at line 143 of file InterprocessConnection.cpp.

Referenced by hasActiveConnections().

◆ hasActiveConnections()

bool Mema::InterprocessConnectionServerImpl::hasActiveConnections ( )

Definition at line 158 of file InterprocessConnection.cpp.

References hasActiveConnection().

Member Data Documentation

◆ onConnectionCreated

std::function<void(int)> Mema::InterprocessConnectionServerImpl::onConnectionCreated

Definition at line 76 of file InterprocessConnection.h.

◆ s_listSizeThreshold

constexpr double Mema::InterprocessConnectionServerImpl::s_listSizeThreshold = 35.0
staticconstexpr

Definition at line 78 of file InterprocessConnection.h.

Referenced by enqueueMessage(), and getListHealth().


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