Orbit Framework
An ultra-modern, asynchronous, cross-platform C++ Web Framework.
Loading...
Searching...
No Matches
server::Listener Class Reference

Listens for incoming network connections. More...

#include <Listener.hpp>

Public Member Functions

 Listener (uint16_t port)
 Constructs a Listener on the specified port.
 
void start ()
 Starts the listener to accept connections.
 
std::optional< network::Socketaccept_connection ()
 Accepts a new incoming connection.
 
int fd () const
 Gets the underlying file descriptor for epoll registration.
 

Detailed Description

Listens for incoming network connections.

Constructor & Destructor Documentation

◆ Listener()

server::Listener::Listener ( uint16_t  port)
explicit

Constructs a Listener on the specified port.

Parameters
portThe port to listen on.

Member Function Documentation

◆ accept_connection()

std::optional< network::Socket > server::Listener::accept_connection ( )

Accepts a new incoming connection.

Returns
An optional Socket if a connection was accepted, std::nullopt otherwise.

◆ fd()

int server::Listener::fd ( ) const

Gets the underlying file descriptor for epoll registration.

Returns
The file descriptor.

◆ start()

void server::Listener::start ( )

Starts the listener to accept connections.


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