MXS-2196: Make client DCB creation private to Listener

The functions that the Listener uses are now private functions. Also moved
the function documentation into the headers.
This commit is contained in:
Markus Mäkelä
2018-12-02 02:46:03 +02:00
parent cca3d15b90
commit 3df38bc887
2 changed files with 33 additions and 20 deletions

View File

@ -173,12 +173,6 @@ public:
*/
void print_users(DCB* dcb);
// TODO: Move dcb_accept code into listener.cc and remove this
int fd() const
{
return m_fd;
}
// Functions that are temporarily public
bool create_listener_config(const char* filename);
struct users* users() const;
@ -241,9 +235,34 @@ private:
const std::string& protocol, const std::string& authenticator,
const std::string& auth_opts, void* auth_instance, SSL_LISTENER* ssl);
// Listen on a file descriptor shared between all workers
/**
* Listen on a file descriptor shared between all workers
*
* @param config_bind The bind configuration consisting of an address and a port separated by the pipe
* character. For UNIX domain sockets, the address is the socket path and the port
* is always zero.
*
* @return True if the listening was started successfully
*/
bool listen_shared(std::string config_bind);
/**
* Accept a single client connection
*
* @return The new DCB or nullptr on error
*/
DCB* accept_one_dcb();
/**
* The file descriptor for accepting new connections
*
* When SO_REUSEPORT is in use, each worker has a separate file descriptor that they accept on.
*/
int fd() const
{
return m_fd;
}
// Handler for EPOLL_IN events
static uint32_t poll_handler(MXB_POLL_DATA* data, MXB_WORKER* worker, uint32_t events);
};