2023-06-05 01:16:05 +02:00
|
|
|
/* SPDX-License-Identifier: MPL-2.0 */
|
2015-12-07 13:19:45 +01:00
|
|
|
|
|
|
|
#ifndef __ZMQ_VMCI_LISTENER_HPP_INCLUDED__
|
|
|
|
#define __ZMQ_VMCI_LISTENER_HPP_INCLUDED__
|
|
|
|
|
|
|
|
#include "platform.hpp"
|
|
|
|
|
|
|
|
#if defined ZMQ_HAVE_VMCI
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include "fd.hpp"
|
2021-02-20 19:08:25 +01:00
|
|
|
#include "vmci_address.hpp"
|
|
|
|
#include "stream_listener_base.hpp"
|
2015-12-07 13:19:45 +01:00
|
|
|
|
|
|
|
namespace zmq
|
|
|
|
{
|
2021-02-20 19:08:25 +01:00
|
|
|
class vmci_listener_t ZMQ_FINAL : public stream_listener_base_t
|
2015-12-07 13:19:45 +01:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
vmci_listener_t (zmq::io_thread_t *io_thread_,
|
|
|
|
zmq::socket_base_t *socket_,
|
|
|
|
const options_t &options_);
|
|
|
|
|
|
|
|
// Set address to listen on.
|
2019-02-01 16:47:31 +01:00
|
|
|
int set_local_address (const char *addr_);
|
2015-12-07 13:19:45 +01:00
|
|
|
|
2021-02-20 19:08:25 +01:00
|
|
|
protected:
|
|
|
|
std::string get_socket_name (fd_t fd_, socket_end_t socket_end_) const;
|
2015-12-07 13:19:45 +01:00
|
|
|
|
2018-02-01 11:46:09 +01:00
|
|
|
private:
|
2015-12-07 13:19:45 +01:00
|
|
|
// Handlers for I/O events.
|
2016-01-22 15:34:23 +01:00
|
|
|
void in_event ();
|
2015-12-07 13:19:45 +01:00
|
|
|
|
|
|
|
// Accept the new connection. Returns the file descriptor of the
|
|
|
|
// newly created connection. The function may return retired_fd
|
|
|
|
// if the connection was dropped while waiting in the listen backlog.
|
|
|
|
fd_t accept ();
|
|
|
|
|
2021-02-20 19:08:25 +01:00
|
|
|
int create_socket (const char *addr_);
|
2015-12-07 13:19:45 +01:00
|
|
|
|
2021-02-20 19:08:25 +01:00
|
|
|
// Address to listen on.
|
|
|
|
vmci_address_t _address;
|
2015-12-07 13:19:45 +01:00
|
|
|
|
2019-12-08 19:22:04 +01:00
|
|
|
ZMQ_NON_COPYABLE_NOR_MOVABLE (vmci_listener_t)
|
2018-02-01 11:46:09 +01:00
|
|
|
};
|
2015-12-07 13:19:45 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|