NIST Biometric Evaluation Framework
Software components for biometric technology evaluations
be_process_messagecenter.h
Go to the documentation of this file.
1/*
2 * This software was developed at the National Institute of Standards and
3 * Technology (NIST) by employees of the Federal Government in the course
4 * of their official duties. Pursuant to Title 17 Section 105 of the
5 * United States Code, this software is not subject to copyright protection
6 * and is in the public domain. NIST assumes no responsibility whatsoever for
7 * its use by other parties, and makes no guarantees, expressed or implied,
8 * about its quality, reliability, or any other characteristic.
9 */
10
11#ifndef __BE_PROCESS_MESSAGECENTER__
12#define __BE_PROCESS_MESSAGECENTER__
13
14#include <memory>
15
17#include <be_process_manager.h>
19
20namespace BiometricEvaluation
21{
22 namespace Process
23 {
26 {
27 public:
29 static const int CONNECTION_BACKLOG = 10;
31 static const uint16_t DEFAULT_PORT = 7899;
33 static const int DEFAULT_TIMEOUT = 1;
35 static const uint64_t MAX_MESSAGE_LENGTH = 255;
36
45 uint32_t port = MessageCenter::DEFAULT_PORT);
46
57 bool
59 const;
60
76 bool
78 uint32_t &clientID,
79 Memory::uint8Array &message,
80 int numSeconds = -1);
81
91 void
93 uint32_t clientID,
94 const Memory::uint8Array &message)
95 const;
96
104 void
106 uint32_t clientID);
107
108 private:
110 std::shared_ptr<Process::Manager> _manager;
112 std::shared_ptr<Process::WorkerController> _listener;
113 };
114 }
115}
116
117#endif /* __BE_PROCESS_MESSAGECENTER__ */
Convenience for asynchronous TCP socket message passing.
bool hasUnseenMessages() const
Determine whether or not there are unseen messages.
void disconnectClient(uint32_t clientID)
Break the connection with a client.
MessageCenter(uint32_t port=MessageCenter::DEFAULT_PORT)
Constructor.
static const int CONNECTION_BACKLOG
Number of outstanding connections.
static const uint64_t MAX_MESSAGE_LENGTH
Maximum length of a message.
static const int DEFAULT_TIMEOUT
Default number of seconds to wait between polls.
bool getNextMessage(uint32_t &clientID, Memory::uint8Array &message, int numSeconds=-1)
Get the next available message.
static const uint16_t DEFAULT_PORT
Default port used for messages.
void sendResponse(uint32_t clientID, const Memory::uint8Array &message) const
Send a message to a client.
This software was developed at the National Institute of Standards and Technology (NIST) by employees...