NIST Biometric Evaluation Framework
Software components for biometric technology evaluations
Public Member Functions | Static Public Attributes | List of all members
BiometricEvaluation::Process::MessageCenter Class Reference

Convenience for asynchronous TCP socket message passing. More...

#include <be_process_messagecenter.h>

Public Member Functions

 MessageCenter (uint32_t port=MessageCenter::DEFAULT_PORT)
 Constructor. More...
 
bool hasUnseenMessages () const
 Determine whether or not there are unseen messages. More...
 
bool getNextMessage (uint32_t &clientID, Memory::uint8Array &message, int numSeconds=-1)
 Get the next available message. More...
 
void sendResponse (uint32_t clientID, const Memory::uint8Array &message) const
 Send a message to a client. More...
 
void disconnectClient (uint32_t clientID)
 Break the connection with a client. More...
 

Static Public Attributes

static const int CONNECTION_BACKLOG = 10
 Number of outstanding connections. More...
 
static const uint16_t DEFAULT_PORT = 7899
 Default port used for messages. More...
 
static const int DEFAULT_TIMEOUT = 1
 Default number of seconds to wait between polls. More...
 
static const uint64_t MAX_MESSAGE_LENGTH = 255
 Maximum length of a message. More...
 

Detailed Description

Convenience for asynchronous TCP socket message passing.

Definition at line 25 of file be_process_messagecenter.h.

Constructor & Destructor Documentation

◆ MessageCenter()

BiometricEvaluation::Process::MessageCenter::MessageCenter ( uint32_t  port = MessageCenter::DEFAULT_PORT)

Constructor.

Parameters
portListening port.

Member Function Documentation

◆ hasUnseenMessages()

bool BiometricEvaluation::Process::MessageCenter::hasUnseenMessages ( ) const

Determine whether or not there are unseen messages.

Returns
true if a message has been received and not read.
Note
Returns immediately.

◆ getNextMessage()

bool BiometricEvaluation::Process::MessageCenter::getNextMessage ( uint32_t &  clientID,
Memory::uint8Array message,
int  numSeconds = -1 
)

Get the next available message.

Parameters
[out]clientIDID of the client that sent the message.
[in,out]messageMessage received.
[in]numSecondsNumber of seconds to wait for a message, or < 0 to block indefinitely.
Returns
true if a message was received before timing out.

◆ sendResponse()

void BiometricEvaluation::Process::MessageCenter::sendResponse ( uint32_t  clientID,
const Memory::uint8Array message 
) const

Send a message to a client.

Parameters
clientIDID of client to receive message.
messageMessage to send client.

◆ disconnectClient()

void BiometricEvaluation::Process::MessageCenter::disconnectClient ( uint32_t  clientID)

Break the connection with a client.

Parameters
clientIDID of the client to disconect.

Member Data Documentation

◆ CONNECTION_BACKLOG

const int BiometricEvaluation::Process::MessageCenter::CONNECTION_BACKLOG = 10
static

Number of outstanding connections.

Definition at line 29 of file be_process_messagecenter.h.

◆ DEFAULT_PORT

const uint16_t BiometricEvaluation::Process::MessageCenter::DEFAULT_PORT = 7899
static

Default port used for messages.

Definition at line 31 of file be_process_messagecenter.h.

◆ DEFAULT_TIMEOUT

const int BiometricEvaluation::Process::MessageCenter::DEFAULT_TIMEOUT = 1
static

Default number of seconds to wait between polls.

Definition at line 33 of file be_process_messagecenter.h.

◆ MAX_MESSAGE_LENGTH

const uint64_t BiometricEvaluation::Process::MessageCenter::MAX_MESSAGE_LENGTH = 255
static

Maximum length of a message.

Definition at line 35 of file be_process_messagecenter.h.


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